Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8758c885 authored by Andrew Lunn's avatar Andrew Lunn Committed by Jason Cooper
Browse files

ARM: Kirkwood: Use fixed-regulator instead of board gpio call



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: default avatarAndrew Lunn <andrew@lunn.ch>
Tested-by: default avatarStefan Peter <s.peter@mplch>
Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent d2268be3
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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>;
		};
	};
};
+0 −4
Original line number Diff line number Diff line
@@ -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);