Re: [PATCH V3 1/2] mfd: Add driver for STA2X11 MFD block

From: Alessandro Rubini
Date: Mon Apr 16 2012 - 14:11:20 EST


Hello Samuel, thanks for commenting.

> - You should not select GPIO_STA2X11 as this won't select the STA2X211 gpio
> driver dependencies for you. So if you build this driver with GPIOLIB=n then
> your build will fail.

Ok. I recall this now, but I've forgotten while editing.

> - Why would this one depend on STA2X11 ? I see that you're calling
> sta2x11_get_instance() from this driver but I wonder if you could simply
> replace the mfd->instance pointer with one pointing to the pci_dev. Not
> depending on STA2X11 at all gives you the benefit of a much larger build
> coverage from linux-next for example.

Right. But I need to know the instance, because other drivers will
call on mfd for some configuration, and I need to match their device
instance with the mfd one. The sta2x11 is a complex bridge, with 4
sub-buses, but being pci you can in theory plug two such boards
in the same computer, and I'd love that setup to work properly.

>> +/* Bar 0 */
>> +enum bar0_cells {
>> + GPIO_0 = 0,
>> + GPIO_1,
>> + GPIO_2,
>> + GPIO_3,
>> + SCTL,
>> + SCR,
>> + TIME,
>> +};
> Please protect those ones with a proper namespace.

I remember this and I didn't do it on purpose (but I didn't comment on
the submission because so much time had passed). I protected all the
gpio bits, but this is only a local shortcut (it's in the .c
file), to name the ordering of the hardware blocks in the mfd.
It's only used a few lines later to build resource addresses.

Thanks
/alessandro
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/