qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* should we have a Kconfig "device group" for I2C devices?
@ 2022-01-28 14:17 Peter Maydell
  2022-01-28 14:30 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2022-01-28 14:17 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Paolo Bonzini, Philippe Mathieu-Daudé

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 ?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-30 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-28 14:17 should we have a Kconfig "device group" for I2C devices? Peter Maydell
2022-01-28 14:30 ` Paolo Bonzini
2022-01-30 19:16   ` Philippe Mathieu-Daudé via

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).