From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: should we have a Kconfig "device group" for I2C devices?
Date: Fri, 28 Jan 2022 15:30:11 +0100 [thread overview]
Message-ID: <ac920f6c-de23-b93a-4d5a-db807aeace3a@redhat.com> (raw)
In-Reply-To: <CAFEAcA-VUOa3R8_BZzJ0d3+RQyZJgwQ-P+3RWPHBoJQYUc7_Mg@mail.gmail.com>
On 1/28/22 15:17, Peter Maydell wrote:
> Hi; I've been looking into what is the right way to handle in Kconfig
> an i2c device which is intended for the user to specify on the command
> line with a -device option.
> (It's the lsm303dlhc magnetometer, currently in code review:
> https://patchew.org/QEMU/20210921093227.18592-1-kevin.townsend@linaro.org/ )
>
> Currently all our i2c devices are just pulled in by "select FOO" from
> the Kconfig stanza for a board which has that kind of sensor hardwired
> on-board. But for at least some of them it works fine to just specify
> them on the commandline of any board that has an i2c controller that
> allows pluggable devices. (For instance we do that kind of commandline
> plugging in our test suite with tests/qtest/tmp105-test.c.)
>
> What's the best way to structure this? For PCI we have the "device
> group" PCI_DEVICES as documented in
> https://qemu-project.gitlab.io/qemu/devel/kconfig.html#guidelines-for-writing-kconfig-files
> and PCI devices say
> default y if PCI_DEVICES
> depends on PCI
>
> For ISA devices we seem to make them say
> default y
> depends on ISA_BUS
>
> I2C devices currently just say
> depends on I2C
>
> Should we have an I2C_DEVICES, which boards where there's a sensible
> user-pluggable i2c controller can specifically select ? Or should we
> mark the i2c devices which are sensibly user-pluggable as
> "default y" ? Or something else ?
Yes, I think it's a good idea to have I2C_DEVICES like we have
PCI_DEVICES. This way we can skip them on x86 (where the SMBus
controller is mostly a legacy device) but include them by default on
AVR, embedded ARM, etc.
Paolo
next prev parent reply other threads:[~2022-01-28 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 14:17 should we have a Kconfig "device group" for I2C devices? Peter Maydell
2022-01-28 14:30 ` Paolo Bonzini [this message]
2022-01-30 19:16 ` Philippe Mathieu-Daudé via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac920f6c-de23-b93a-4d5a-db807aeace3a@redhat.com \
--to=pbonzini@redhat.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).