diff mbox

[3/3] ARM: DTS: TWL4030: fix mux and wakeup for SYS_NIRQ line

Message ID 1370040357-25794-4-git-send-email-khilman@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Kevin Hilman May 31, 2013, 10:45 p.m. UTC
On most OMAP3 platforms, the twl4030 IRQ line is connected to the
SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
SYS_NIRQ pin in the twl4030 DTS file.

Boards that hook up the twl4030 differently can easily override this
in their board-specific DTS file.

This allows RTC wake from off-mode to work again on OMAP3-based
platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
3530/Overo, 3730/Overo-STORM.

Signed-off-by: Kevin Hilman <khilman@linaro.org>
---
 arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Florian Vaussard June 3, 2013, 9:48 a.m. UTC | #1
Hello Kevin,

On 06/01/2013 12:45 AM, Kevin Hilman wrote:
> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
> SYS_NIRQ pin in the twl4030 DTS file.
>
> Boards that hook up the twl4030 differently can easily override this
> in their board-specific DTS file.
>
> This allows RTC wake from off-mode to work again on OMAP3-based
> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
> 3530/Overo, 3730/Overo-STORM.
>
> Signed-off-by: Kevin Hilman <khilman@linaro.org>
> ---
>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
> index b3034da..c7fe9f6 100644
> --- a/arch/arm/boot/dts/twl4030.dtsi
> +++ b/arch/arm/boot/dts/twl4030.dtsi
> @@ -13,6 +13,8 @@
>   	compatible = "ti,twl4030";
>   	interrupt-controller;
>   	#interrupt-cells = <1>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&twl4030_pins>;
>
>   	rtc {
>   		compatible = "ti,twl4030-rtc";
> @@ -92,3 +94,18 @@
>   		#pwm-cells = <2>;
>   	};
>   };
> +
> +&omap3_pmx_core {

Here you are making the TWL4030 to explicitly depend on OMAP3. Could 
this chip be
used by another target? If the case, I would put this piece of code in 
the files
including twl4030. Otherwise it's ok here.

> +	/*
> +	 * On most OMAP3 platforms, the twl4030 IRQ line is connected
> +         * to the SYS_NIRQ line on OMAP.  Therefore, configure the
> +         * defaults for the SYS_NIRQ pin here.  Boards that hook up
> +         * the twl4030 differently can easily override this in their
> +         * board-specific DTS file.
> +	 */
> +	twl4030_pins: pinmux_twl4030_pins {
> +		pinctrl-single,pins = <
> +			0x1b0 0x4118 /*	sys_nirq.sys_nirq WAKEUP | INPUT_PULLUP | MODE 0 */

By using pinctrl constants:

			0x1b0 (PIN_INPUT_PULLUP | WAKEUP_EN | MUX_MODE0)	/* sys_nirq.sys_nirq */

> +		>;
> +	};
> +};
>

I will test this afternoon on an Overo.

Regards,

Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hilman June 3, 2013, 10:19 p.m. UTC | #2
Florian Vaussard <florian.vaussard@epfl.ch> writes:

> Hello Kevin,
>
> On 06/01/2013 12:45 AM, Kevin Hilman wrote:
>> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
>> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
>> SYS_NIRQ pin in the twl4030 DTS file.
>>
>> Boards that hook up the twl4030 differently can easily override this
>> in their board-specific DTS file.
>>
>> This allows RTC wake from off-mode to work again on OMAP3-based
>> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
>> 3530/Overo, 3730/Overo-STORM.
>>
>> Signed-off-by: Kevin Hilman <khilman@linaro.org>
>> ---
>>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
>> index b3034da..c7fe9f6 100644
>> --- a/arch/arm/boot/dts/twl4030.dtsi
>> +++ b/arch/arm/boot/dts/twl4030.dtsi
>> @@ -13,6 +13,8 @@
>>   	compatible = "ti,twl4030";
>>   	interrupt-controller;
>>   	#interrupt-cells = <1>;
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&twl4030_pins>;
>>
>>   	rtc {
>>   		compatible = "ti,twl4030-rtc";
>> @@ -92,3 +94,18 @@
>>   		#pwm-cells = <2>;
>>   	};
>>   };
>> +
>> +&omap3_pmx_core {
>
> Here you are making the TWL4030 to explicitly depend on OMAP3. Could
> this chip be used by another target? If the case, I would put this
> piece of code in the files including twl4030. Otherwise it's ok here.

I talked this over with Tony before posting.  In theorry, it could be
used on other platforms.  In practice, it's only used on OMAP.  We can
easily move this to board files if needed later, but thought it would be
simpler to put it here.  I'll let Benoit decide.

>> +	/*
>> +	 * On most OMAP3 platforms, the twl4030 IRQ line is connected
>> +         * to the SYS_NIRQ line on OMAP.  Therefore, configure the
>> +         * defaults for the SYS_NIRQ pin here.  Boards that hook up
>> +         * the twl4030 differently can easily override this in their
>> +         * board-specific DTS file.
>> +	 */
>> +	twl4030_pins: pinmux_twl4030_pins {
>> +		pinctrl-single,pins = <
>> +			0x1b0 0x4118 /*	sys_nirq.sys_nirq WAKEUP | INPUT_PULLUP | MODE 0 */
>
> By using pinctrl constants:
>
> 			0x1b0 (PIN_INPUT_PULLUP | WAKEUP_EN | MUX_MODE0)	/* sys_nirq.sys_nirq */

Yup.

>> +		>;
>> +	};
>> +};
>>
>
> I will test this afternoon on an Overo.

Thanks,

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Cooper June 3, 2013, 10:39 p.m. UTC | #3
On Mon, Jun 03, 2013 at 03:19:25PM -0700, Kevin Hilman wrote:
> Florian Vaussard <florian.vaussard@epfl.ch> writes:
> 
> > Hello Kevin,
> >
> > On 06/01/2013 12:45 AM, Kevin Hilman wrote:
> >> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
> >> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
> >> SYS_NIRQ pin in the twl4030 DTS file.
> >>
> >> Boards that hook up the twl4030 differently can easily override this
> >> in their board-specific DTS file.
> >>
> >> This allows RTC wake from off-mode to work again on OMAP3-based
> >> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
> >> 3530/Overo, 3730/Overo-STORM.
> >>
> >> Signed-off-by: Kevin Hilman <khilman@linaro.org>
> >> ---
> >>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
> >>   1 file changed, 17 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
> >> index b3034da..c7fe9f6 100644
> >> --- a/arch/arm/boot/dts/twl4030.dtsi
> >> +++ b/arch/arm/boot/dts/twl4030.dtsi
> >> @@ -13,6 +13,8 @@
> >>   	compatible = "ti,twl4030";
> >>   	interrupt-controller;
> >>   	#interrupt-cells = <1>;
> >> +	pinctrl-names = "default";
> >> +	pinctrl-0 = <&twl4030_pins>;
> >>
> >>   	rtc {
> >>   		compatible = "ti,twl4030-rtc";
> >> @@ -92,3 +94,18 @@
> >>   		#pwm-cells = <2>;
> >>   	};
> >>   };
> >> +
> >> +&omap3_pmx_core {
> >
> > Here you are making the TWL4030 to explicitly depend on OMAP3. Could
> > this chip be used by another target? If the case, I would put this
> > piece of code in the files including twl4030. Otherwise it's ok here.
> 
> I talked this over with Tony before posting.  In theorry, it could be
> used on other platforms.  In practice, it's only used on OMAP.  We can
> easily move this to board files if needed later, but thought it would be
> simpler to put it here.  I'll let Benoit decide.

What about omap boards that don't use the twl4030?  eg I'm currently
tinkering with a board that uses a tps6507x...

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hilman June 4, 2013, 5:58 p.m. UTC | #4
Jason Cooper <jason@lakedaemon.net> writes:

> On Mon, Jun 03, 2013 at 03:19:25PM -0700, Kevin Hilman wrote:
>> Florian Vaussard <florian.vaussard@epfl.ch> writes:
>> 
>> > Hello Kevin,
>> >
>> > On 06/01/2013 12:45 AM, Kevin Hilman wrote:
>> >> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
>> >> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
>> >> SYS_NIRQ pin in the twl4030 DTS file.
>> >>
>> >> Boards that hook up the twl4030 differently can easily override this
>> >> in their board-specific DTS file.
>> >>
>> >> This allows RTC wake from off-mode to work again on OMAP3-based
>> >> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
>> >> 3530/Overo, 3730/Overo-STORM.
>> >>
>> >> Signed-off-by: Kevin Hilman <khilman@linaro.org>
>> >> ---
>> >>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
>> >>   1 file changed, 17 insertions(+)
>> >>
>> >> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
>> >> index b3034da..c7fe9f6 100644
>> >> --- a/arch/arm/boot/dts/twl4030.dtsi
>> >> +++ b/arch/arm/boot/dts/twl4030.dtsi
>> >> @@ -13,6 +13,8 @@
>> >>   	compatible = "ti,twl4030";
>> >>   	interrupt-controller;
>> >>   	#interrupt-cells = <1>;
>> >> +	pinctrl-names = "default";
>> >> +	pinctrl-0 = <&twl4030_pins>;
>> >>
>> >>   	rtc {
>> >>   		compatible = "ti,twl4030-rtc";
>> >> @@ -92,3 +94,18 @@
>> >>   		#pwm-cells = <2>;
>> >>   	};
>> >>   };
>> >> +
>> >> +&omap3_pmx_core {
>> >
>> > Here you are making the TWL4030 to explicitly depend on OMAP3. Could
>> > this chip be used by another target? If the case, I would put this
>> > piece of code in the files including twl4030. Otherwise it's ok here.
>> 
>> I talked this over with Tony before posting.  In theorry, it could be
>> used on other platforms.  In practice, it's only used on OMAP.  We can
>> easily move this to board files if needed later, but thought it would be
>> simpler to put it here.  I'll let Benoit decide.
>
> What about omap boards that don't use the twl4030?  eg I'm currently
> tinkering with a board that uses a tps6507x...

Then you'll be inclding tps6507x.dtsi instead of twl4030.dtsi and won't
be affected by this patch at all.

Your board file should setup the muxing (using this as an example) for
how your board wires the TPS chip to the OMAP.

Kevin

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Cooper June 4, 2013, 6:05 p.m. UTC | #5
On Tue, Jun 04, 2013 at 10:58:46AM -0700, Kevin Hilman wrote:
> Jason Cooper <jason@lakedaemon.net> writes:
> 
> > On Mon, Jun 03, 2013 at 03:19:25PM -0700, Kevin Hilman wrote:
> >> Florian Vaussard <florian.vaussard@epfl.ch> writes:
> >> 
> >> > Hello Kevin,
> >> >
> >> > On 06/01/2013 12:45 AM, Kevin Hilman wrote:
> >> >> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
> >> >> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
> >> >> SYS_NIRQ pin in the twl4030 DTS file.
> >> >>
> >> >> Boards that hook up the twl4030 differently can easily override this
> >> >> in their board-specific DTS file.
> >> >>
> >> >> This allows RTC wake from off-mode to work again on OMAP3-based
> >> >> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
> >> >> 3530/Overo, 3730/Overo-STORM.
> >> >>
> >> >> Signed-off-by: Kevin Hilman <khilman@linaro.org>
> >> >> ---
> >> >>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
> >> >>   1 file changed, 17 insertions(+)
> >> >>
> >> >> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
> >> >> index b3034da..c7fe9f6 100644
> >> >> --- a/arch/arm/boot/dts/twl4030.dtsi
> >> >> +++ b/arch/arm/boot/dts/twl4030.dtsi
> >> >> @@ -13,6 +13,8 @@
> >> >>   	compatible = "ti,twl4030";
> >> >>   	interrupt-controller;
> >> >>   	#interrupt-cells = <1>;
> >> >> +	pinctrl-names = "default";
> >> >> +	pinctrl-0 = <&twl4030_pins>;
> >> >>
> >> >>   	rtc {
> >> >>   		compatible = "ti,twl4030-rtc";
> >> >> @@ -92,3 +94,18 @@
> >> >>   		#pwm-cells = <2>;
> >> >>   	};
> >> >>   };
> >> >> +
> >> >> +&omap3_pmx_core {
> >> >
> >> > Here you are making the TWL4030 to explicitly depend on OMAP3. Could
> >> > this chip be used by another target? If the case, I would put this
> >> > piece of code in the files including twl4030. Otherwise it's ok here.
> >> 
> >> I talked this over with Tony before posting.  In theorry, it could be
> >> used on other platforms.  In practice, it's only used on OMAP.  We can
> >> easily move this to board files if needed later, but thought it would be
> >> simpler to put it here.  I'll let Benoit decide.
> >
> > What about omap boards that don't use the twl4030?  eg I'm currently
> > tinkering with a board that uses a tps6507x...
> 
> Then you'll be inclding tps6507x.dtsi instead of twl4030.dtsi and won't
> be affected by this patch at all.

Gah!  I saw omap3_pmx_core being modified and missed that the mod was in
twl4030.dtsi.  Of course, you are right.

> Your board file should setup the muxing (using this as an example) for
> how your board wires the TPS chip to the OMAP.

Yes, that's the fun part, I'm trying to get a vanilla kernel to boot on
the Seagate Wireless Plus.  They didn't exactly hand out schematics ;-)

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Florian Vaussard June 5, 2013, 7:41 a.m. UTC | #6
On 06/04/2013 12:19 AM, Kevin Hilman wrote:
> Florian Vaussard <florian.vaussard@epfl.ch> writes:
>
>> Hello Kevin,
>>
>> On 06/01/2013 12:45 AM, Kevin Hilman wrote:
>>> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
>>> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
>>> SYS_NIRQ pin in the twl4030 DTS file.
>>>
>>> Boards that hook up the twl4030 differently can easily override this
>>> in their board-specific DTS file.
>>>
>>> This allows RTC wake from off-mode to work again on OMAP3-based
>>> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
>>> 3530/Overo, 3730/Overo-STORM.
>>>
>>> Signed-off-by: Kevin Hilman <khilman@linaro.org>
>>> ---
>>>    arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
>>>    1 file changed, 17 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
>>> index b3034da..c7fe9f6 100644
>>> --- a/arch/arm/boot/dts/twl4030.dtsi
>>> +++ b/arch/arm/boot/dts/twl4030.dtsi
>>> @@ -13,6 +13,8 @@
>>>    	compatible = "ti,twl4030";
>>>    	interrupt-controller;
>>>    	#interrupt-cells = <1>;
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&twl4030_pins>;
>>>
>>>    	rtc {
>>>    		compatible = "ti,twl4030-rtc";
>>> @@ -92,3 +94,18 @@
>>>    		#pwm-cells = <2>;
>>>    	};
>>>    };
>>> +
>>> +&omap3_pmx_core {
>>
>> Here you are making the TWL4030 to explicitly depend on OMAP3. Could
>> this chip be used by another target? If the case, I would put this
>> piece of code in the files including twl4030. Otherwise it's ok here.
>
> I talked this over with Tony before posting.  In theorry, it could be
> used on other platforms.  In practice, it's only used on OMAP.  We can
> easily move this to board files if needed later, but thought it would be
> simpler to put it here.  I'll let Benoit decide.
>

Ok, so I am fine with your approach. If need arises later, we can have
a .dtsi file in-between to make the glue layer and avoid duplication inside
board files.

Regards,

Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benoit Cousson June 5, 2013, 1:52 p.m. UTC | #7
Salut Kevin,

On 06/04/2013 12:19 AM, Kevin Hilman wrote:
> Florian Vaussard <florian.vaussard@epfl.ch> writes:
> 
>> Hello Kevin,
>>
>> On 06/01/2013 12:45 AM, Kevin Hilman wrote:
>>> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
>>> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
>>> SYS_NIRQ pin in the twl4030 DTS file.
>>>
>>> Boards that hook up the twl4030 differently can easily override this
>>> in their board-specific DTS file.
>>>
>>> This allows RTC wake from off-mode to work again on OMAP3-based
>>> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
>>> 3530/Overo, 3730/Overo-STORM.
>>>
>>> Signed-off-by: Kevin Hilman <khilman@linaro.org>
>>> ---
>>>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
>>>   1 file changed, 17 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
>>> index b3034da..c7fe9f6 100644
>>> --- a/arch/arm/boot/dts/twl4030.dtsi
>>> +++ b/arch/arm/boot/dts/twl4030.dtsi
>>> @@ -13,6 +13,8 @@
>>>   	compatible = "ti,twl4030";
>>>   	interrupt-controller;
>>>   	#interrupt-cells = <1>;
>>> +	pinctrl-names = "default";
>>> +	pinctrl-0 = <&twl4030_pins>;
>>>
>>>   	rtc {
>>>   		compatible = "ti,twl4030-rtc";
>>> @@ -92,3 +94,18 @@
>>>   		#pwm-cells = <2>;
>>>   	};
>>>   };
>>> +
>>> +&omap3_pmx_core {
>>
>> Here you are making the TWL4030 to explicitly depend on OMAP3. Could
>> this chip be used by another target? If the case, I would put this
>> piece of code in the files including twl4030. Otherwise it's ok here.
> 
> I talked this over with Tony before posting.  In theorry, it could be
> used on other platforms.  In practice, it's only used on OMAP.  We can
> easily move this to board files if needed later, but thought it would be
> simpler to put it here.  I'll let Benoit decide.

Yeah, I don't like that either. Some twl variants are used on other
platform. And these variants might include the original twl4030 as a
base. None of them are in mainline for sure, but anyway adding SoC stuff
in external IC file is not a good practice.

I don't want people in the future using that as an excuse for similar hacks.

The easiest way is to create an extra file including the platform free
twl4030 file and adding the OMAP3 specific config on top of that.
Every OMAP3 boards will the used that file. Otherwise you can hack each
boards.


Regards,
Benoit


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hilman June 5, 2013, 2:26 p.m. UTC | #8
Benoit Cousson <b-cousson@ti.com> writes:

> Salut Kevin,
>
> On 06/04/2013 12:19 AM, Kevin Hilman wrote:
>> Florian Vaussard <florian.vaussard@epfl.ch> writes:
>> 
>>> Hello Kevin,
>>>
>>> On 06/01/2013 12:45 AM, Kevin Hilman wrote:
>>>> On most OMAP3 platforms, the twl4030 IRQ line is connected to the
>>>> SYS_NIRQ line on OMAP.  Therefore, configure the defaults for the
>>>> SYS_NIRQ pin in the twl4030 DTS file.
>>>>
>>>> Boards that hook up the twl4030 differently can easily override this
>>>> in their board-specific DTS file.
>>>>
>>>> This allows RTC wake from off-mode to work again on OMAP3-based
>>>> platforms with twl4030.  Tested on 3530/Beagle, 3730/Beagle-xM,
>>>> 3530/Overo, 3730/Overo-STORM.
>>>>
>>>> Signed-off-by: Kevin Hilman <khilman@linaro.org>
>>>> ---
>>>>   arch/arm/boot/dts/twl4030.dtsi | 17 +++++++++++++++++
>>>>   1 file changed, 17 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
>>>> index b3034da..c7fe9f6 100644
>>>> --- a/arch/arm/boot/dts/twl4030.dtsi
>>>> +++ b/arch/arm/boot/dts/twl4030.dtsi
>>>> @@ -13,6 +13,8 @@
>>>>   	compatible = "ti,twl4030";
>>>>   	interrupt-controller;
>>>>   	#interrupt-cells = <1>;
>>>> +	pinctrl-names = "default";
>>>> +	pinctrl-0 = <&twl4030_pins>;
>>>>
>>>>   	rtc {
>>>>   		compatible = "ti,twl4030-rtc";
>>>> @@ -92,3 +94,18 @@
>>>>   		#pwm-cells = <2>;
>>>>   	};
>>>>   };
>>>> +
>>>> +&omap3_pmx_core {
>>>
>>> Here you are making the TWL4030 to explicitly depend on OMAP3. Could
>>> this chip be used by another target? If the case, I would put this
>>> piece of code in the files including twl4030. Otherwise it's ok here.
>> 
>> I talked this over with Tony before posting.  In theorry, it could be
>> used on other platforms.  In practice, it's only used on OMAP.  We can
>> easily move this to board files if needed later, but thought it would be
>> simpler to put it here.  I'll let Benoit decide.
>
> Yeah, I don't like that either. Some twl variants are used on other
> platform. And these variants might include the original twl4030 as a
> base. None of them are in mainline for sure, but anyway adding SoC stuff
> in external IC file is not a good practice.
>
> I don't want people in the future using that as an excuse for similar hacks.
>
> The easiest way is to create an extra file including the platform free
> twl4030 file and adding the OMAP3 specific config on top of that.
> Every OMAP3 boards will the used that file. Otherwise you can hack each
> boards.

Yeah, somehow I knew you would say that.  I'll respin.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index b3034da..c7fe9f6 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -13,6 +13,8 @@ 
 	compatible = "ti,twl4030";
 	interrupt-controller;
 	#interrupt-cells = <1>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&twl4030_pins>;
 
 	rtc {
 		compatible = "ti,twl4030-rtc";
@@ -92,3 +94,18 @@ 
 		#pwm-cells = <2>;
 	};
 };
+
+&omap3_pmx_core {
+	/*
+	 * On most OMAP3 platforms, the twl4030 IRQ line is connected
+         * to the SYS_NIRQ line on OMAP.  Therefore, configure the
+         * defaults for the SYS_NIRQ pin here.  Boards that hook up
+         * the twl4030 differently can easily override this in their
+         * board-specific DTS file.
+	 */
+	twl4030_pins: pinmux_twl4030_pins {
+		pinctrl-single,pins = <
+			0x1b0 0x4118 /*	sys_nirq.sys_nirq WAKEUP | INPUT_PULLUP | MODE 0 */
+		>;
+	};
+};