From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/11] ARM: Kirkwood: Use fixed-regulator instead of board gpio call
Date: Sun, 6 Jan 2013 11:10:38 +0100 [thread overview]
Message-ID: <1357467044-4914-6-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1357467044-4914-1-git-send-email-andrew@lunn.ch>
With the change to a DT based pinctrl/gpio driver, using gpio API
calls in board-*.c files no longer works, a dereferenced NULL pointer
exception occurs instead. By converting the GPIO code into a
fixed-regulator which gets probed later once pinctrl/gpio is
available, we avoid the exception.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Stefan Peter <s.peter@mplch>
---
arch/arm/boot/dts/kirkwood-topkick.dts | 17 +++++++++++++++++
arch/arm/mach-kirkwood/board-usi_topkick.c | 4 ----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index c0de5a7..cd15452 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -82,4 +82,21 @@
gpios = <&gpio1 16 1>;
};
};
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sata0_power: regulator at 1 {
+ compatible = "regulator-fixed";
+ reg = <1>;
+ regulator-name = "SATA0 Power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ regulator-always-on;
+ regulator-boot-on;
+ gpio = <&gpio1 4 0>;
+ };
+ };
};
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 15e69fc..23d2dd1 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -64,8 +64,6 @@ static unsigned int topkick_mpp_config[] __initdata = {
0
};
-#define TOPKICK_SATA0_PWR_ENABLE 36
-
void __init usi_topkick_init(void)
{
/*
@@ -73,8 +71,6 @@ void __init usi_topkick_init(void)
*/
kirkwood_mpp_conf(topkick_mpp_config);
- /* SATA0 power enable */
- gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
kirkwood_ge00_init(&topkick_ge00_data);
kirkwood_sdio_init(&topkick_mvsdio_data);
--
1.7.10.4
next prev parent reply other threads:[~2013-01-06 10:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-06 10:10 [PATCH 00/11] Fixes for 3.8-rc Andrew Lunn
2013-01-06 10:10 ` [PATCH 01/11] ARM: Kirkwood: Fix missing clk for USB device Andrew Lunn
2013-01-07 15:11 ` Simon Guinot
2013-01-07 15:27 ` Andrew Lunn
2013-01-06 10:10 ` [PATCH 02/11] Power: gpio-poweroff: Fix documentation and gpio_is_valid Andrew Lunn
2013-01-06 10:10 ` [PATCH 03/11] ARM: Kirkwood: Switch TWSI1 of 88f6282 to DT clock providers Andrew Lunn
2013-01-06 10:10 ` [PATCH 04/11] ARM: Kirkwood: Fix missing sdio clock Andrew Lunn
2013-01-06 10:10 ` Andrew Lunn [this message]
2013-01-06 10:10 ` [PATCH 06/11] clk: mvebu: Remove inappropriate __init tagging Andrew Lunn
2013-01-06 10:10 ` [PATCH 07/11] arm: mvebu: Armada XP MV78230 has two cores, not one Andrew Lunn
2013-01-06 10:10 ` [PATCH 08/11] arm: mvebu: Armada XP MV78230 has only three Ethernet interfaces Andrew Lunn
2013-01-06 10:10 ` [PATCH 09/11] arm: mvebu: Add missing ; for cpu node Andrew Lunn
2013-01-06 10:10 ` [PATCH 10/11] dma: mv_xor: fix error handling of mv_xor_channel_add() Andrew Lunn
2013-01-06 10:10 ` [PATCH 11/11] dma: mv_xor: fix error handling for clocks Andrew Lunn
2013-01-07 13:47 ` [PATCH 00/11] Fixes for 3.8-rc Arnd Bergmann
2013-01-07 13:55 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357467044-4914-6-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).