[PATCH 3/5] gpio/omap: Add DT support to GPIO driver
Javier Martinez Canillas
martinez.javier at gmail.com
Thu Feb 28 07:00:13 EST 2013
On Wed, Feb 27, 2013 at 6:47 PM, Stephen Warren <swarren at wwwdotorg.org> wrote:
> On 02/26/2013 08:33 PM, Javier Martinez Canillas wrote:
> ...
>> Yes, I realized that requesting the gpio was necessary so what I did
>> is to use the "regulator-fixed" optional property "gpio" and define
>> the GPIO used as an IRQ in a regulator used by the SMSC chip. So, I
>> have this on my board DT:
>>
>> vddvario: regulator-vddvario {
>> compatible = "regulator-fixed";
>> regulator-name = "vddvario";
>> regulator-always-on;
>> gpio = <&gpio6 16 8>; /* gpio line 176 */
>> enable-active-high;
>> gpio-open-drain;
>
> While admittedly it's configured as open-drain, that will configure the
> GPIO to be an output, whereas for usage as an interrupt, it really
> should be configured as an input... Perhaps it makes no difference on
> OMAP HW since the I/O paths are separate, but I can easily imagine HW
> where this hack wouldn't work.
>
>> regulator-boot-on;
>> };
>>
>> &gpmc {
>> ethernet at 5,0 {
>> pinctrl-names = "default";
>> pinctrl-0 = <&smsc911x_pins>;
>> compatible = "smsc,lan9221", "smsc,lan9115";
>> reg = <5 0 0xff>;
>> interrupt-parent = <&gpio6>;
>> interrupts = <16 8>; /* gpio line 176 */
>> interrupt-names = "smsc911x irq";
>> vmmc-supply = <&vddvario>;
>> vmmc_aux-supply = <&vdd33a>;
>> reg-io-width = <4>;
>>
>> smsc,save-mac-address;
>> };
>> };
>>
>> That way a call to gpio_request_one() is made and the GPIO is requested.
>>
>> This look a little hack-ish for me but I've seen this in other
>> DeviceTrees like omap4-sdp.dts so I thought it was a common DT
>> pattern.
>
> Indeed; the GPIO is in no way a regulator, so while the above is fine
> for testing, it's in no way a solution that can actually be used and
> checked in.
Yes, this is just a work-in-progress and is not meant to be taken as a
patch submission.
I'm just doing some testing with DT and figuring out how much effort
will take to have the same hardware support we currently with board
files for IGEP boards.
Thanks a lot for your feedback and best regards,
Javier
More information about the devicetree-discuss
mailing list