On 15 March 2016 at 21:40, Jean-Christophe DUBOIS <j...@tribudubois.net> wrote: > Well, each SPI controller has 4 possible CS lines to external devices and I > have 5 SPI controllers. > > This makes 20 externally facing IRQ lines (these are output lines) to add to > the i.MX6 soc object as properties (with a meaningful naming convention). > > And anyway, what I need to pass to sysbus_connect_irq() is a SYS_BUS_DEVICE > and not an IRQ line ...
sysbus_connect_irq() is just syntactic sugar for a qdev_connect_gpio_out_named() call on the sysbus device; in this case you'd have a bunch of named gpio lines on the SoC device and use qdev_connect_gpio_out_named(soc_device, SOC_CS_WHATEVER, 1, cs_line); > So do you mean I should define the 20 external lines (properties) and wire > all of them up with sysbus_connect_irq() in the i.MX6 SOC implementation > (fsl-imx6.c)? If you use qdev_init_gpio_out_named() in the SPI controller (which is probably a good idea anyway, chip selects aren't IRQs so using the gpio functions is clearer naming) then you ought to be able to create the appropriate aliases, since gpios are link properties. However I can't quite figure out how this is supposed to work -- Peter C ? (There's a qdev_pass_gpios() which is almost right but that operates on all gpios rather than a specified subset.) thanks -- PMM