* [PATCH] ARM: dts: imx27-pdk: Add PMIC support
@ 2014-04-15 21:55 Fabio Estevam
2014-04-15 21:58 ` Russell King - ARM Linux
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Fabio Estevam @ 2014-04-15 21:55 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
imx27-pdk has a MC13783 PMIC connected to CSPI2 port.
Add support for it.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/boot/dts/imx27-pdk.dts | 52 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/arch/arm/boot/dts/imx27-pdk.dts b/arch/arm/boot/dts/imx27-pdk.dts
index 430b72b..628abbe 100644
--- a/arch/arm/boot/dts/imx27-pdk.dts
+++ b/arch/arm/boot/dts/imx27-pdk.dts
@@ -21,6 +21,48 @@
};
};
+&cspi2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_cspi2>;
+ fsl,spi-num-chipselects = <1>;
+ cs-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+
+ pmic: mc13783 at 0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl,mc13783";
+ reg = <0>;
+ spi-cs-high;
+ spi-max-frequency = <1000000>;
+ interrupt-parent = <&gpio3>;
+ interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
+
+ regulators {
+ vgen_reg: vgen {
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vmmc1_reg: vmmc1 {
+ regulator-min-microvolt = <1600000>;
+ regulator-max-microvolt = <3000000>;
+ };
+
+ gpo1_reg: gpo1 {
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ gpo3_reg: gpo3 {
+ regulator-always-on;
+ regulator-boot-on;
+ };
+ };
+ };
+};
&fec {
phy-mode = "mii";
@@ -38,6 +80,16 @@
&iomuxc {
imx27-pdk {
+ pinctrl_cspi2: cspi2grp {
+ fsl,pins = <
+ MX27_PAD_CSPI2_MISO__CSPI2_MISO 0x0
+ MX27_PAD_CSPI2_MOSI__CSPI2_MOSI 0x0
+ MX27_PAD_CSPI2_SCLK__CSPI2_SCLK 0x0
+ MX27_PAD_CSPI2_SS0__GPIO4_21 0x0 /* SPI2 CS0 */
+ MX27_PAD_TOUT__GPIO3_14 0x0 /* PMIC IRQ */
+ >;
+ };
+
pinctrl_fec: fecgrp {
fsl,pins = <
MX27_PAD_SD3_CMD__FEC_TXD0 0x0
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH] ARM: dts: imx27-pdk: Add PMIC support
2014-04-15 21:55 [PATCH] ARM: dts: imx27-pdk: Add PMIC support Fabio Estevam
@ 2014-04-15 21:58 ` Russell King - ARM Linux
2014-04-15 22:02 ` Fabio Estevam
2014-04-16 6:18 ` Shawn Guo
2014-04-16 6:37 ` Alexander Shiyan
2 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2014-04-15 21:58 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Apr 15, 2014 at 06:55:12PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> imx27-pdk has a MC13783 PMIC connected to CSPI2 port.
>
> Add support for it.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
The issue I referred to in my reply to your oops does still need fixing
(and testing whether it fixes the oops.)
It's really not on to code drivers such that it's possible to use
resources before they are initialised. That means mutexes and locks
must be initialised before requesting (threaded) IRQs if they're used
by those functions.
In your case, that mutex *definitely* needs initialisation before the
threaded IRQ handler is requested.
--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: dts: imx27-pdk: Add PMIC support
2014-04-15 21:58 ` Russell King - ARM Linux
@ 2014-04-15 22:02 ` Fabio Estevam
0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2014-04-15 22:02 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Apr 15, 2014 at 6:58 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Apr 15, 2014 at 06:55:12PM -0300, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> imx27-pdk has a MC13783 PMIC connected to CSPI2 port.
>>
>> Add support for it.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>
> The issue I referred to in my reply to your oops does still need fixing
> (and testing whether it fixes the oops.)
>
> It's really not on to code drivers such that it's possible to use
> resources before they are initialised. That means mutexes and locks
> must be initialised before requesting (threaded) IRQs if they're used
> by those functions.
>
> In your case, that mutex *definitely* needs initialisation before the
> threaded IRQ handler is requested.
Yes, I agree. I will look at it.
The dt file I sent initially had the wrong SPI port connected to the PMIC.
The PMIC is connected to SPI2 (spi1 in Linux), not SPI1 (spi0 in Linux).
Now it probes correctly, but yes, I will address the issue you raised.
Thanks,
Fabio Estevam
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ARM: dts: imx27-pdk: Add PMIC support
2014-04-15 21:55 [PATCH] ARM: dts: imx27-pdk: Add PMIC support Fabio Estevam
2014-04-15 21:58 ` Russell King - ARM Linux
@ 2014-04-16 6:18 ` Shawn Guo
2014-04-16 6:37 ` Alexander Shiyan
2 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-04-16 6:18 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Apr 15, 2014 at 06:55:12PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> imx27-pdk has a MC13783 PMIC connected to CSPI2 port.
>
> Add support for it.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: imx27-pdk: Add PMIC support
2014-04-15 21:55 [PATCH] ARM: dts: imx27-pdk: Add PMIC support Fabio Estevam
2014-04-15 21:58 ` Russell King - ARM Linux
2014-04-16 6:18 ` Shawn Guo
@ 2014-04-16 6:37 ` Alexander Shiyan
2014-04-16 6:41 ` Shawn Guo
2 siblings, 1 reply; 6+ messages in thread
From: Alexander Shiyan @ 2014-04-16 6:37 UTC (permalink / raw)
To: linux-arm-kernel
Tue, 15 Apr 2014 18:55:12 -0300 ?? Fabio Estevam <festevam@gmail.com>:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> imx27-pdk has a MC13783 PMIC connected to CSPI2 port.
>
> Add support for it.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
...
> &iomuxc {
> imx27-pdk {
> + pinctrl_cspi2: cspi2grp {
> + fsl,pins = <
> + MX27_PAD_CSPI2_MISO__CSPI2_MISO 0x0
> + MX27_PAD_CSPI2_MOSI__CSPI2_MOSI 0x0
> + MX27_PAD_CSPI2_SCLK__CSPI2_SCLK 0x0
> + MX27_PAD_CSPI2_SS0__GPIO4_21 0x0 /* SPI2 CS0 */
> + MX27_PAD_TOUT__GPIO3_14 0x0 /* PMIC IRQ */
> + >;
> + };
IRQ GPIO should be in a separate pingroup for PMIC.
---
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH] ARM: dts: imx27-pdk: Add PMIC support
2014-04-16 6:37 ` Alexander Shiyan
@ 2014-04-16 6:41 ` Shawn Guo
0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-04-16 6:41 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 16, 2014 at 10:37:31AM +0400, Alexander Shiyan wrote:
> Tue, 15 Apr 2014 18:55:12 -0300 ?? Fabio Estevam <festevam@gmail.com>:
> > From: Fabio Estevam <fabio.estevam@freescale.com>
> >
> > imx27-pdk has a MC13783 PMIC connected to CSPI2 port.
> >
> > Add support for it.
> >
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> ...
> > &iomuxc {
> > imx27-pdk {
> > + pinctrl_cspi2: cspi2grp {
> > + fsl,pins = <
> > + MX27_PAD_CSPI2_MISO__CSPI2_MISO 0x0
> > + MX27_PAD_CSPI2_MOSI__CSPI2_MOSI 0x0
> > + MX27_PAD_CSPI2_SCLK__CSPI2_SCLK 0x0
> > + MX27_PAD_CSPI2_SS0__GPIO4_21 0x0 /* SPI2 CS0 */
> > + MX27_PAD_TOUT__GPIO3_14 0x0 /* PMIC IRQ */
> > + >;
> > + };
>
> IRQ GPIO should be in a separate pingroup for PMIC.
Right, patch dropped.
Shawn
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-04-16 6:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 21:55 [PATCH] ARM: dts: imx27-pdk: Add PMIC support Fabio Estevam
2014-04-15 21:58 ` Russell King - ARM Linux
2014-04-15 22:02 ` Fabio Estevam
2014-04-16 6:18 ` Shawn Guo
2014-04-16 6:37 ` Alexander Shiyan
2014-04-16 6:41 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).