Where should special purpose GPIO drivers go?

Jon Medhurst (Tixy) <tixy@...>

I know $subject it's an oxymoron but it's accurate. I have some special
purpose registers to drive hardwired fixed function pins and I'm making
these available to the rest of the system using drivers which implement
the GPIO API. I was wondering whereabouts under the drivers/ directory
they belong.

E.g. one register type is for accessing a pair open collector data/clk
pins wired for bitbang I2C [1]. Does the driver for this belong under
drivers/i2c because it's being used for I2C or under drivers/gpio
because it implements the GPIO API, or somewhere else?

I also have a general purpose driver to represent any 32-bit memory
mapped register using the GPIO API, where would that live? I created
that because my SoC (actually FPGA [2]) has several miscellaneous
registers, some of the bits of which are used for things like SPI chip
select, so I need a GPIO based API to use with the SPI driver.

Note, the SoC also has proper GPIO but the above functions aren't part
of that IP block, so I believe separate drivers are appropriate.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0447j/Bbajdjeg.html
[2] https://www.arm.com/products/tools/development-boards/versatile-express/cortex-m-prototyping-system.php


Join devel@lists.zephyrproject.org to automatically receive all group messages.