* [PATCH 0/3] Convert more of NSA310 to DT.
@ 2012-12-28 14:08 Andrew Lunn
2012-12-28 14:08 ` [PATCH 1/3] ARM: Kirkwood: Convert NSA310 to DT based regulators Andrew Lunn
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Andrew Lunn @ 2012-12-28 14:08 UTC (permalink / raw)
To: linux-arm-kernel
This patchset converts more of the NSA310 into device tree.
Currently untested.
Andrew Lunn (3):
ARM: Kirkwood: Convert NSA310 to DT based regulators.
ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver
ARM: Kirkwood: Convert NSA310 I2C to device tree
arch/arm/boot/dts/kirkwood-nsa310.dts | 27 +++++++++++++++++++++
arch/arm/mach-kirkwood/board-nsa310.c | 43 ---------------------------------
2 files changed, 27 insertions(+), 43 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] ARM: Kirkwood: Convert NSA310 to DT based regulators.
2012-12-28 14:08 [PATCH 0/3] Convert more of NSA310 to DT Andrew Lunn
@ 2012-12-28 14:08 ` Andrew Lunn
2012-12-28 14:08 ` [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver Andrew Lunn
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2012-12-28 14:08 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
arch/arm/boot/dts/kirkwood-nsa310.dts | 17 +++++++++++++++++
arch/arm/mach-kirkwood/board-nsa310.c | 4 ----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index 5509f96..2dc1d09 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -141,4 +141,21 @@
gpios = <&gpio1 8 0>;
};
};
+
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ usb0_power_off: regulator at 1 {
+ compatible = "regulator-fixed";
+ reg = <1>;
+ regulator-name = "USB Power Off";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ regulator-boot-on;
+ gpio = <&gpio0 21 0>;
+ };
+ };
};
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index f58d2e1..d04184d 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -19,7 +19,6 @@
#include "common.h"
#include "mpp.h"
-#define NSA310_GPIO_USB_POWER_OFF 21
#define NSA310_GPIO_POWER_OFF 48
static unsigned int nsa310_mpp_config[] __initdata = {
@@ -72,9 +71,6 @@ static void __init nsa310_gpio_init(void)
"Power Off");
if (!err)
pm_power_off = nsa310_power_off;
-
- nsa310_gpio_request(NSA310_GPIO_USB_POWER_OFF, GPIOF_OUT_INIT_LOW,
- "USB Power Off");
}
void __init nsa310_init(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver
2012-12-28 14:08 [PATCH 0/3] Convert more of NSA310 to DT Andrew Lunn
2012-12-28 14:08 ` [PATCH 1/3] ARM: Kirkwood: Convert NSA310 to DT based regulators Andrew Lunn
@ 2012-12-28 14:08 ` Andrew Lunn
2012-12-29 5:24 ` Jason Cooper
2012-12-28 14:08 ` [PATCH 3/3] ARM: Kirkwood: Convert NSA310 I2C to device tree Andrew Lunn
2013-01-23 13:13 ` [PATCH 0/3] Convert more of NSA310 to DT Jason Cooper
3 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2012-12-28 14:08 UTC (permalink / raw)
To: linux-arm-kernel
Remove the C code and add a Device Tree node for gpio-poweroff.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
arch/arm/boot/dts/kirkwood-nsa310.dts | 5 +++++
arch/arm/mach-kirkwood/board-nsa310.c | 33 ---------------------------------
2 files changed, 5 insertions(+), 33 deletions(-)
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index 2dc1d09..85cce36 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -142,6 +142,11 @@
};
};
+ gpio_poweroff {
+ compatible = "gpio-poweroff";
+ gpios = <&gpio1 16 0>;
+ };
+
regulators {
compatible = "simple-bus";
#address-cells = <1>;
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index d04184d..7a56273 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -11,7 +11,6 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/i2c.h>
-#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -19,8 +18,6 @@
#include "common.h"
#include "mpp.h"
-#define NSA310_GPIO_POWER_OFF 48
-
static unsigned int nsa310_mpp_config[] __initdata = {
MPP12_GPIO, /* led esata green */
MPP13_GPIO, /* led esata red */
@@ -45,42 +42,12 @@ static struct i2c_board_info __initdata nsa310_i2c_info[] = {
{ I2C_BOARD_INFO("adt7476", 0x2e) },
};
-static void nsa310_power_off(void)
-{
- gpio_set_value(NSA310_GPIO_POWER_OFF, 1);
-}
-
-static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags,
- const char *label)
-{
- int err;
-
- err = gpio_request_one(gpio, flags, label);
- if (err)
- pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n",
- gpio, label, err);
-
- return err;
-}
-
-static void __init nsa310_gpio_init(void)
-{
- int err;
-
- err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW,
- "Power Off");
- if (!err)
- pm_power_off = nsa310_power_off;
-}
-
void __init nsa310_init(void)
{
u32 dev, rev;
kirkwood_mpp_conf(nsa310_mpp_config);
- nsa310_gpio_init();
-
kirkwood_pcie_id(&dev, &rev);
i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] ARM: Kirkwood: Convert NSA310 I2C to device tree
2012-12-28 14:08 [PATCH 0/3] Convert more of NSA310 to DT Andrew Lunn
2012-12-28 14:08 ` [PATCH 1/3] ARM: Kirkwood: Convert NSA310 to DT based regulators Andrew Lunn
2012-12-28 14:08 ` [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver Andrew Lunn
@ 2012-12-28 14:08 ` Andrew Lunn
2013-01-23 13:13 ` [PATCH 0/3] Convert more of NSA310 to DT Jason Cooper
3 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2012-12-28 14:08 UTC (permalink / raw)
To: linux-arm-kernel
Add a sub-node into the I2C node to represent the adt7476 device.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
arch/arm/boot/dts/kirkwood-nsa310.dts | 5 +++++
arch/arm/mach-kirkwood/board-nsa310.c | 6 ------
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index 85cce36..dbb3551 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -29,6 +29,11 @@
i2c at 11000 {
status = "okay";
+
+ adt7476: adt7476a at 2e {
+ compatible = "adt7476";
+ reg = <0x2e>;
+ };
};
nand at 3000000 {
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 7a56273..1bd328d 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -38,10 +38,6 @@ static unsigned int nsa310_mpp_config[] __initdata = {
0
};
-static struct i2c_board_info __initdata nsa310_i2c_info[] = {
- { I2C_BOARD_INFO("adt7476", 0x2e) },
-};
-
void __init nsa310_init(void)
{
u32 dev, rev;
@@ -49,8 +45,6 @@ void __init nsa310_init(void)
kirkwood_mpp_conf(nsa310_mpp_config);
kirkwood_pcie_id(&dev, &rev);
-
- i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
}
static int __init nsa310_pci_init(void)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver
2012-12-28 14:08 ` [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver Andrew Lunn
@ 2012-12-29 5:24 ` Jason Cooper
2012-12-29 7:51 ` Andrew Lunn
0 siblings, 1 reply; 7+ messages in thread
From: Jason Cooper @ 2012-12-29 5:24 UTC (permalink / raw)
To: linux-arm-kernel
Andrew,
On Fri, Dec 28, 2012 at 03:08:49PM +0100, Andrew Lunn wrote:
> Remove the C code and add a Device Tree node for gpio-poweroff.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
> arch/arm/boot/dts/kirkwood-nsa310.dts | 5 +++++
> arch/arm/mach-kirkwood/board-nsa310.c | 33 ---------------------------------
> 2 files changed, 5 insertions(+), 33 deletions(-)
>
> diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
> index 2dc1d09..85cce36 100644
> --- a/arch/arm/boot/dts/kirkwood-nsa310.dts
> +++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
> @@ -142,6 +142,11 @@
> };
> };
>
> + gpio_poweroff {
> + compatible = "gpio-poweroff";
> + gpios = <&gpio1 16 0>;
> + };
> +
> regulators {
> compatible = "simple-bus";
> #address-cells = <1>;
> diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> index d04184d..7a56273 100644
> --- a/arch/arm/mach-kirkwood/board-nsa310.c
> +++ b/arch/arm/mach-kirkwood/board-nsa310.c
> @@ -11,7 +11,6 @@
> #include <linux/kernel.h>
> #include <linux/init.h>
> #include <linux/i2c.h>
> -#include <linux/gpio.h>
>
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> @@ -19,8 +18,6 @@
> #include "common.h"
> #include "mpp.h"
>
> -#define NSA310_GPIO_POWER_OFF 48
> -
> static unsigned int nsa310_mpp_config[] __initdata = {
> MPP12_GPIO, /* led esata green */
> MPP13_GPIO, /* led esata red */
> @@ -45,42 +42,12 @@ static struct i2c_board_info __initdata nsa310_i2c_info[] = {
> { I2C_BOARD_INFO("adt7476", 0x2e) },
> };
>
> -static void nsa310_power_off(void)
> -{
> - gpio_set_value(NSA310_GPIO_POWER_OFF, 1);
> -}
> -
> -static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags,
> - const char *label)
> -{
> - int err;
> -
> - err = gpio_request_one(gpio, flags, label);
> - if (err)
> - pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n",
> - gpio, label, err);
> -
> - return err;
> -}
> -
> -static void __init nsa310_gpio_init(void)
> -{
> - int err;
> -
> - err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW,
> - "Power Off");
> - if (!err)
> - pm_power_off = nsa310_power_off;
> -}
> -
> void __init nsa310_init(void)
> {
> u32 dev, rev;
>
> kirkwood_mpp_conf(nsa310_mpp_config);
Are you working on this?
thx,
Jason.
>
> - nsa310_gpio_init();
> -
> kirkwood_pcie_id(&dev, &rev);
>
> i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info));
> --
> 1.7.10.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver
2012-12-29 5:24 ` Jason Cooper
@ 2012-12-29 7:51 ` Andrew Lunn
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Lunn @ 2012-12-29 7:51 UTC (permalink / raw)
To: linux-arm-kernel
> > kirkwood_mpp_conf(nsa310_mpp_config);
>
> Are you working on this?
No. i've not started on pinctrl yet.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/3] Convert more of NSA310 to DT.
2012-12-28 14:08 [PATCH 0/3] Convert more of NSA310 to DT Andrew Lunn
` (2 preceding siblings ...)
2012-12-28 14:08 ` [PATCH 3/3] ARM: Kirkwood: Convert NSA310 I2C to device tree Andrew Lunn
@ 2013-01-23 13:13 ` Jason Cooper
3 siblings, 0 replies; 7+ messages in thread
From: Jason Cooper @ 2013-01-23 13:13 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 28, 2012 at 03:08:47PM +0100, Andrew Lunn wrote:
> This patchset converts more of the NSA310 into device tree.
>
> Currently untested.
>
> Andrew Lunn (3):
> ARM: Kirkwood: Convert NSA310 to DT based regulators.
> ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver
> ARM: Kirkwood: Convert NSA310 I2C to device tree
>
> arch/arm/boot/dts/kirkwood-nsa310.dts | 27 +++++++++++++++++++++
> arch/arm/mach-kirkwood/board-nsa310.c | 43 ---------------------------------
> 2 files changed, 27 insertions(+), 43 deletions(-)
Whole series applied to mvebu/dt
thx,
Jason.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-01-23 13:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-28 14:08 [PATCH 0/3] Convert more of NSA310 to DT Andrew Lunn
2012-12-28 14:08 ` [PATCH 1/3] ARM: Kirkwood: Convert NSA310 to DT based regulators Andrew Lunn
2012-12-28 14:08 ` [PATCH 2/3] ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver Andrew Lunn
2012-12-29 5:24 ` Jason Cooper
2012-12-29 7:51 ` Andrew Lunn
2012-12-28 14:08 ` [PATCH 3/3] ARM: Kirkwood: Convert NSA310 I2C to device tree Andrew Lunn
2013-01-23 13:13 ` [PATCH 0/3] Convert more of NSA310 to DT Jason Cooper
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).