summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-22 23:26:33 +0200
committerJason Cooper <jason@lakedaemon.net>2014-04-26 21:45:16 +0200
commit39eabec14c05ec67e9afe56711b040728de1d533 (patch)
tree483d0891cd6ff1c6bcadeddad9a945d2cdc9edfd
parentARM: orion5x: convert edmini_v2 to DT pinctrl (diff)
downloadlinux-39eabec14c05ec67e9afe56711b040728de1d533.tar.xz
linux-39eabec14c05ec67e9afe56711b040728de1d533.zip
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>
-rw-r--r--arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts14
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c24
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 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
#include "orion5x-mv88f5182.dtsi"
/ {
@@ -63,6 +64,19 @@
};
};
+&i2c {
+ status = "okay";
+ clock-frequency = <100000>;
+ #address-cells = <1>;
+
+ rtc@32 {
+ compatible = "ricoh,rs5c372a";
+ reg = <0x32>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
&mdio {
status = "okay";
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 = {
};
/*****************************************************************************
- * RTC 5C372a on I2C bus
- ****************************************************************************/
-
-#define EDMINIV2_RTC_GPIO 3
-
-static struct i2c_board_info __initdata edmini_v2_i2c_rtc = {
- I2C_BOARD_INFO("rs5c372a", 0x32),
- .irq = 0,
-};
-
-/*****************************************************************************
* General Setup
****************************************************************************/
@@ -125,17 +114,4 @@ void __init edmini_v2_init(void)
pr_notice("edmini_v2: USB device port, flash write and power-off "
"are not yet supported.\n");
-
- /* Get RTC IRQ and register the chip */
- if (gpio_request(EDMINIV2_RTC_GPIO, "rtc") == 0) {
- if (gpio_direction_input(EDMINIV2_RTC_GPIO) == 0)
- edmini_v2_i2c_rtc.irq = gpio_to_irq(EDMINIV2_RTC_GPIO);
- else
- gpio_free(EDMINIV2_RTC_GPIO);
- }
-
- if (edmini_v2_i2c_rtc.irq == 0)
- pr_warning("edmini_v2: failed to get RTC IRQ\n");
-
- i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1);
}