Skip to content

Commit

Permalink
ARM: Kirkwood: Use fixed-regulator instead of board gpio call
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
  • Loading branch information
Andrew Lunn authored and Jason Cooper committed Jan 6, 2013
1 parent d2268be commit 8758c88
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 17 additions & 0 deletions arch/arm/boot/dts/kirkwood-topkick.dts
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,21 @@
gpios = <&gpio1 16 1>;
};
};
regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;

sata0_power: regulator@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>;
};
};
};
4 changes: 0 additions & 4 deletions arch/arm/mach-kirkwood/board-usi_topkick.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ static unsigned int topkick_mpp_config[] __initdata = {
0
};

#define TOPKICK_SATA0_PWR_ENABLE 36

void __init usi_topkick_init(void)
{
/*
* Basic setup. Needs to be called early.
*/
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);
Expand Down

0 comments on commit 8758c88

Please sign in to comment.