diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-04-22 17:26:33 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-04-26 15:45:16 -0400 |
commit | 39eabec14c05ec67e9afe56711b040728de1d533 (patch) | |
tree | 483d0891cd6ff1c6bcadeddad9a945d2cdc9edfd /arch | |
parent | 43be7e02f634422f105217e82559e3b716b3351d (diff) |
ARM: orion5x: use DT to describe I2C devices on edmini_v2
This commit converts the already partially DT-converted edmini_v2
platform to use the Device Tree for I2C bus and devices.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Link: https://lkml.kernel.org/r/1398202002-28530-30-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts | 14 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/edmini_v2-setup.c | 24 |
2 files changed, 14 insertions, 24 deletions
diff --git a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts index aa74b00d68e2..41b2ab567bf5 100644 --- a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts +++ b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <dt-bindings/gpio/gpio.h> | 11 | #include <dt-bindings/gpio/gpio.h> |
12 | #include <dt-bindings/input/input.h> | 12 | #include <dt-bindings/input/input.h> |
13 | #include <dt-bindings/interrupt-controller/irq.h> | ||
13 | #include "orion5x-mv88f5182.dtsi" | 14 | #include "orion5x-mv88f5182.dtsi" |
14 | 15 | ||
15 | / { | 16 | / { |
@@ -63,6 +64,19 @@ | |||
63 | }; | 64 | }; |
64 | }; | 65 | }; |
65 | 66 | ||
67 | &i2c { | ||
68 | status = "okay"; | ||
69 | clock-frequency = <100000>; | ||
70 | #address-cells = <1>; | ||
71 | |||
72 | rtc@32 { | ||
73 | compatible = "ricoh,rs5c372a"; | ||
74 | reg = <0x32>; | ||
75 | interrupt-parent = <&gpio0>; | ||
76 | interrupts = <3 IRQ_TYPE_LEVEL_LOW>; | ||
77 | }; | ||
78 | }; | ||
79 | |||
66 | &mdio { | 80 | &mdio { |
67 | status = "okay"; | 81 | status = "okay"; |
68 | 82 | ||
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c index c50469e978de..75648abbee92 100644 --- a/arch/arm/mach-orion5x/edmini_v2-setup.c +++ b/arch/arm/mach-orion5x/edmini_v2-setup.c | |||
@@ -96,17 +96,6 @@ static struct platform_device edmini_v2_nor_flash = { | |||
96 | }; | 96 | }; |
97 | 97 | ||
98 | /***************************************************************************** | 98 | /***************************************************************************** |
99 | * RTC 5C372a on I2C bus | ||
100 | ****************************************************************************/ | ||
101 | |||
102 | #define EDMINIV2_RTC_GPIO 3 | ||
103 | |||
104 | static struct i2c_board_info __initdata edmini_v2_i2c_rtc = { | ||
105 | I2C_BOARD_INFO("rs5c372a", 0x32), | ||
106 | .irq = 0, | ||
107 | }; | ||
108 | |||
109 | /***************************************************************************** | ||
110 | * General Setup | 99 | * General Setup |
111 | ****************************************************************************/ | 100 | ****************************************************************************/ |
112 | 101 | ||
@@ -125,17 +114,4 @@ void __init edmini_v2_init(void) | |||
125 | 114 | ||
126 | pr_notice("edmini_v2: USB device port, flash write and power-off " | 115 | pr_notice("edmini_v2: USB device port, flash write and power-off " |
127 | "are not yet supported.\n"); | 116 | "are not yet supported.\n"); |
128 | |||
129 | /* Get RTC IRQ and register the chip */ | ||
130 | if (gpio_request(EDMINIV2_RTC_GPIO, "rtc") == 0) { | ||
131 | if (gpio_direction_input(EDMINIV2_RTC_GPIO) == 0) | ||
132 | edmini_v2_i2c_rtc.irq = gpio_to_irq(EDMINIV2_RTC_GPIO); | ||
133 | else | ||
134 | gpio_free(EDMINIV2_RTC_GPIO); | ||
135 | } | ||
136 | |||
137 | if (edmini_v2_i2c_rtc.irq == 0) | ||
138 | pr_warning("edmini_v2: failed to get RTC IRQ\n"); | ||
139 | |||
140 | i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1); | ||
141 | } | 117 | } |