Skip to contentSkip to conversation

Add ADC driver for Atmel G20, G45 and X5 boards

PATCH Superseded Maxime Ripard 4 participants 19 messages May 9, 2012 – May 11, 2012

Subsystems (5)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

Hi all,

Here is another version of the patches to bring ADC driver to Atmel boards. Since last version, here is what changed:
* Rebased on top of staging-next to move out of staging. Had to change to IIO kfifo buffer along the way.
* Reworked the DT bindings according to Jean-Christophe reviews
* Made various fixes according to reviews
* Support for X5 boards

Thanks,
Maxime

#1 lore raw

PATCH 1/9 ARM: AT91: Add platform data for the AT91 ADCs

The AT91 SoCs often embeds an ADC. This patch adds the needed platform data to specify the informations required by the driver to work properly.

For now, we only need the reference voltage and which channels are available on the board.

---
 include/linux/platform_data/at91_adc.h |   61 ++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 include/linux/platform_data/at91_adc.h
include/linux/platform_data/at91_adc.h new file +61 -0
new file mode 100644
index 0000000..f9e2f00
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 Free Electrons
+ *
+ * Licensed under the GPLv2 or later.
+ */
+
+#ifndef _AT91_ADC_H_
+#define _AT91_ADC_H_
+
+/**
+ * struct at91_adc_reg_desc - Various informations relative to registers
+ * @channel_base:	Base address for the channel data registers
+ * @drdy_mask:		Mask of the DRDY field in the relevant registers
+			(Interruptions registers mostly)
+ * @status_register:	Address of the Interrupt Status Register
+ * @trigger_register:	Address of the Trigger setup register
+ */
+struct at91_adc_reg_desc {
+	u8	channel_base;
+	u32	drdy_mask;
+	u8	status_register;
+	u8	trigger_register;
+};
+
+/**
+ * struct at91_adc_trigger - description of triggers
+ * @name:		name of the trigger advertised to the user
+ * @value:		value to set in the ADC's mode register to enable
+			the trigger
+ * @is_external:	is the trigger relies on an external pin ?
+ */
+struct at91_adc_trigger {
+	const char	*name;
+	u8		value;
+	bool		is_external;
+};
+
+/**
+ * struct at91_adc_data - platform data for ADC driver
+ * @channels_used:		channels in use on the board as a bitmask
+ * @num_channels:		global number of channels available on the board
+ * @registers:			Registers definition on the board
+ * @startup_time:		startup time of the ADC in microseconds
+ * @trigger_list:		Triggers available in the ADC
+ * @trigger_number:		Number of triggers available in the ADC
+ * @use_external_triggers:	does the board has external triggers availables
+ * @vref:			Reference voltage for the ADC in millivolts
+ */
+struct at91_adc_data {
+	unsigned long			channels_used;
+	u8				num_channels;
+	struct at91_adc_reg_desc	*registers;
+	u8				startup_time;
+	struct at91_adc_trigger		*trigger_list;
+	u8				trigger_number;
+	bool				use_external_triggers;
+	u16				vref;
+};
+
+extern void __init at91_add_device_adc(struct at91_adc_data *data);
+#endif
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/9 ARM: AT91: Add platform data for the AT91 ADCs

Quoted 6 lines · Maxime Ripard

The AT91 SoCs often embeds an ADC. This patch adds the needed platform data to specify the informations required by the driver to work properly.

For now, we only need the reference voltage and which channels are available on the board.

One utterly trivial element inline.

Quoted 1 line
Quoted 31 lines
---
  include/linux/platform_data/at91_adc.h |   61 ++++++++++++++++++++++++++++++++
  1 file changed, 61 insertions(+)

create mode 100644 include/linux/platform_data/at91_adc.h

include/linux/platform_data/at91_adc.h new file +20 -0
new file mode 100644
index 0000000..f9e2f00
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 Free Electrons
+ *
+ * Licensed under the GPLv2 or later.
+ */
+
+#ifndef _AT91_ADC_H_
+#define _AT91_ADC_H_
+
+/**
+ * struct at91_adc_reg_desc - Various informations relative to registers
+ * @channel_base:	Base address for the channel data registers
+ * @drdy_mask:		Mask of the DRDY field in the relevant registers
+			(Interruptions registers mostly)
+ * @status_register:	Address of the Interrupt Status Register
+ * @trigger_register:	Address of the Trigger setup register
+ */
+struct at91_adc_reg_desc {
+	u8	channel_base;
+	u32	drdy_mask;

include/linux/platform_data/at91_adc.h line 30

Quoted 10 lines
include/linux/platform_data/at91_adc.h new file +10 -0
+	u8	status_register;
+	u8	trigger_register;
+};
+
+/**
+ * struct at91_adc_trigger - description of triggers
+ * @name:		name of the trigger advertised to the user
+ * @value:		value to set in the ADC's mode register to enable
+			the trigger
+ * @is_external:	is the trigger relies on an external pin ?

no space before the ? (nitpick of the day ;)

Quoted 31 lines
include/linux/platform_data/at91_adc.h new file +31 -0
+ */
+struct at91_adc_trigger {
+	const char	*name;
+	u8		value;
+	bool		is_external;
+};
+
+/**
+ * struct at91_adc_data - platform data for ADC driver
+ * @channels_used:		channels in use on the board as a bitmask
+ * @num_channels:		global number of channels available on the board
+ * @registers:			Registers definition on the board
+ * @startup_time:		startup time of the ADC in microseconds
+ * @trigger_list:		Triggers available in the ADC
+ * @trigger_number:		Number of triggers available in the ADC
+ * @use_external_triggers:	does the board has external triggers availables
+ * @vref:			Reference voltage for the ADC in millivolts
+ */
+struct at91_adc_data {
+	unsigned long			channels_used;
+	u8				num_channels;
+	struct at91_adc_reg_desc	*registers;
+	u8				startup_time;
+	struct at91_adc_trigger		*trigger_list;
+	u8				trigger_number;
+	bool				use_external_triggers;
+	u16				vref;
+};
+
+extern void __init at91_add_device_adc(struct at91_adc_data *data);
+#endif
#3 lore raw

PATCH 2/9 ARM: AT91: IIO: Add AT91 ADC driver.

In reply to Maxime Ripard

Add the ADC driver for Atmel's AT91SAM9G20-EK, AT91SAM9M10G45-EK and AT91SAM9X5 family boards.

It has support for both software and hardware triggers.

---
 drivers/iio/Kconfig        |    2 +
 drivers/iio/Makefile       |    2 +
 drivers/iio/adc/Kconfig    |   16 ++
 drivers/iio/adc/Makefile   |    5 +
 drivers/iio/adc/at91_adc.c |  674 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 699 insertions(+)
 create mode 100644 drivers/iio/adc/Kconfig
 create mode 100644 drivers/iio/adc/Makefile
 create mode 100644 drivers/iio/adc/at91_adc.c
drivers/iio/Kconfig +2 -0
index 3ab7d48..47e0920 100644
@@ -48,4 +48,6 @@ config IIO_CONSUMERS_PER_TRIGGER
 	This value controls the maximum number of consumers that a
 	given trigger may handle. Default is 2.
 
+source "drivers/iio/adc/Kconfig"
+
 endif # IIO
drivers/iio/Makefile +2 -0
index d5fc57d..eb926a2 100644
@@ -8,3 +8,5 @@ industrialio-$(CONFIG_IIO_BUFFER) += industrialio-buffer.o
 industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o
 
 obj-$(CONFIG_IIO_KFIFO_BUF) += kfifo_buf.o
+
+obj-y += adc/
drivers/iio/adc/Kconfig new file +16 -0
new file mode 100644
index 0000000..9a0df81
@@ -0,0 +1,16 @@
+#
+# ADC drivers
+#
+menu "Analog to digital converters"
+
+config AT91_ADC
+	tristate "Atmel AT91 ADC"
+	depends on ARCH_AT91
+	select IIO_BUFFER
+	select IIO_KFIFO_BUF
+	select IIO_TRIGGER
+	select SYSFS
+	help
+	  Say yes here to build support for Atmel AT91 ADC.
+
+endmenu
drivers/iio/adc/Makefile new file +5 -0
new file mode 100644
index 0000000..b62d488
@@ -0,0 +1,5 @@
+#
+# Makefile for IIO ADC drivers
+#
+
+obj-$(CONFIG_AT91_ADC) += at91_adc.o
\ No newline at end of file
drivers/iio/adc/at91_adc.c new file +674 -0

674 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 3/9 ARM: AT91: Add the ADC to the sam9g20ek board

In reply to Maxime Ripard

This patch adds platform data for the AT91 ADC driver support for the AT91SAM9G20-EK board.

---
 arch/arm/mach-at91/at91sam9260.c         |    8 +++
 arch/arm/mach-at91/at91sam9260_devices.c |   89 ++++++++++++++++++++++++++++++
 arch/arm/mach-at91/board-sam9g20ek.c     |   14 +++++
 3 files changed, 111 insertions(+)
arch/arm/mach-at91/at91sam9260.c +8 -0
index 46f7742..63d4432 100644
@@ -55,6 +55,13 @@ static struct clk adc_clk = {
 	.pmc_mask	= 1 << AT91SAM9260_ID_ADC,
 	.type		= CLK_TYPE_PERIPHERAL,
 };
+
+static struct clk adc_op_clk = {
+	.name		= "adc_op_clk",
+	.type		= CLK_TYPE_PERIPHERAL,
+	.rate_hz	= 5000000,
+};
+
 static struct clk usart0_clk = {
 	.name		= "usart0_clk",
 	.pmc_mask	= 1 << AT91SAM9260_ID_US0,
@@ -166,6 +173,7 @@ static struct clk *periph_clocks[] __initdata = {
 	&pioB_clk,
 	&pioC_clk,
 	&adc_clk,
+	&adc_op_clk,
 	&usart0_clk,
 	&usart1_clk,
 	&usart2_clk,
arch/arm/mach-at91/at91sam9260_devices.c +89 -0

101 lines not on this page · raw message

arch/arm/mach-at91/board-sam9g20ek.c +14 -0
index 8923ec9..291b0fe 100644
@@ -32,6 +32,8 @@
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/consumer.h>
 
+#include <linux/platform_data/at91_adc.h>
+
 #include <mach/hardware.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -318,6 +320,16 @@ static void __init ek_add_device_buttons(void)
 static void __init ek_add_device_buttons(void) {}
 #endif
 
+/*
+ * ADCs
+ */
+
+static struct at91_adc_data ek_adc_data = {
+	.channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3),
+	.use_external_triggers = true,
+	.vref = 3300,
+};
+
 #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
 static struct regulator_consumer_supply ek_audio_consumer_supplies[] = {
 	REGULATOR_SUPPLY("AVDD", "0-001b"),
@@ -393,6 +405,8 @@ static void __init ek_board_init(void)
 	ek_add_device_gpio_leds();
 	/* Push Buttons */
 	ek_add_device_buttons();
+	/* ADCs */
+	at91_add_device_adc(&ek_adc_data);
 	/* PCK0 provides MCLK to the WM8731 */
 	at91_set_B_periph(AT91_PIN_PC1, 0);
 	/* SSC (for WM8731) */
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 4/9 IIO: AT91: ADC: Add support for the AT91SAM9M10G45-EK board

In reply to Maxime Ripard

This patch adds platform data for the AT91 ADC driver support for the AT91SAM9M10G45-EK board.

---
 arch/arm/mach-at91/at91sam9g45.c         |    9 +++
 arch/arm/mach-at91/at91sam9g45_devices.c |  101 ++++++++++++++++++++++++++++++
 arch/arm/mach-at91/board-sam9m10g45ek.c  |   12 ++++
 3 files changed, 122 insertions(+)
arch/arm/mach-at91/at91sam9g45.c +9 -0
index d222f83..30865c6 100644
@@ -176,6 +176,12 @@ static struct clk vdec_clk = {
 	.type		= CLK_TYPE_PERIPHERAL,
 };
 
+static struct clk adc_op_clk = {
+	.name		= "adc_op_clk",
+	.type		= CLK_TYPE_PERIPHERAL,
+	.rate_hz	= 13200000,
+};
+
 static struct clk *periph_clocks[] __initdata = {
 	&pioA_clk,
 	&pioB_clk,
@@ -204,6 +210,7 @@ static struct clk *periph_clocks[] __initdata = {
 	&isi_clk,
 	&udphs_clk,
 	&mmc1_clk,
+	&adc_op_clk,
 	// irq0
 };
 
@@ -242,6 +249,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_ID("pioC", &pioC_clk),
 	CLKDEV_CON_ID("pioD", &pioDE_clk),
 	CLKDEV_CON_ID("pioE", &pioDE_clk),
+	/* Fake adc clock */
+	CLKDEV_CON_ID("adc_clk", &tsc_clk),
 };
 
 static struct clk_lookup usart_clocks_lookups[] = {
arch/arm/mach-at91/at91sam9g45_devices.c +101 -0

116 lines not on this page · raw message

arch/arm/mach-at91/board-sam9m10g45ek.c +12 -0
index c88e908..337abd2 100644
@@ -27,6 +27,8 @@
 #include <linux/atmel-mci.h>
 #include <linux/delay.h>
 
+#include <linux/platform_data/at91_adc.h>
+
 #include <mach/hardware.h>
 #include <video/atmel_lcdc.h>
 #include <media/soc_camera.h>
@@ -315,6 +317,14 @@ static struct at91_tsadcc_data ek_tsadcc_data = {
 	.ts_sample_hold_time	= 0x0a,
 };
 
+/*
+ * ADCs
+ */
+static struct at91_adc_data ek_adc_data = {
+	.channels_used = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5) | BIT(6) | BIT(7),
+	.use_external_triggers = true,
+	.vref = 3300,
+};
 
 /*
  * GPIO Buttons
@@ -480,6 +490,8 @@ static void __init ek_board_init(void)
 	at91_add_device_lcdc(&ek_lcdc_data);
 	/* Touch Screen */
 	at91_add_device_tsadcc(&ek_tsadcc_data);
+	/* ADC */
+	at91_add_device_adc(&ek_adc_data);
 	/* Push Buttons */
 	ek_add_device_buttons();
 	/* AC97 */
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 5/9 Add clocks for X5 boards

In reply to Maxime Ripard
---
 arch/arm/mach-at91/at91sam9x5.c |    6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-at91/at91sam9x5.c +6 -0
index 13c8cae..1b144b4 100644
@@ -120,6 +120,11 @@ static struct clk adc_clk = {
 	.pmc_mask	= 1 << AT91SAM9X5_ID_ADC,
 	.type	= CLK_TYPE_PERIPHERAL,
 };
+static struct clk adc_op_clk = {
+	.name		= "adc_op_clk",
+	.type		= CLK_TYPE_PERIPHERAL,
+	.rate_hz	= 5000000,
+};
 static struct clk dma0_clk = {
 	.name		= "dma0_clk",
 	.pmc_mask	= 1 << AT91SAM9X5_ID_DMA0,
@@ -205,6 +210,7 @@ static struct clk *periph_clocks[] __initdata = {
 	&tcb0_clk,
 	&pwm_clk,
 	&adc_clk,
+	&adc_op_clk,
 	&dma0_clk,
 	&dma1_clk,
 	&uhphs_clk,
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 6/9 IIO: AT91: Add DT support to at91_adc driver

In reply to Maxime Ripard
---
 .../devicetree/bindings/arm/atmel-adc.txt          |   65 ++++++++++
 drivers/iio/adc/at91_adc.c                         |  133 +++++++++++++++++++-
 2 files changed, 197 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/arm/atmel-adc.txt
Documentation/devicetree/bindings/arm/atmel-adc.txt new file +65 -0
new file mode 100644
index 0000000..da2b67d
@@ -0,0 +1,65 @@
+* AT91's Analog to Digital Converter (ADC)
+
+Required properties:
+  - compatible: Should be "atmel,at91-adc"
+  - reg: Should contain ADC registers location and length
+  - interrupts: Should contain the IRQ line for the ADC
+  - atmel,adc-channel-base: Address of the first channel data register
+  - atmel,adc-channels-used: Bitmask of the channels muxed and enable for this
+    device
+  - atmel,adc-drdy-mask: Mask of the DRDY interruption in the ADC
+  - atmel,adc-num-channels: Number of channels available in the ADC
+  - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
+    defined in the datasheet
+  - atmel,adc-status-register: Address of the Interrupt Status Register
+  - atmel,adc-trigger-register: Address of the Trigger Register
+  - atmel,adc-vref: Reference voltage in millivolts for the conversions
+
+Optional properties:
+  - atmel,adc-use-external: Boolean to enable of external triggers
+ 
+Optional trigger Nodes:
+  - Required properties:
+    * trigger-name: Name of the trigger exposed to the user
+    * trigger-value: Value to put in the Trigger register
+      to activate this trigger
+  - Optional properties:
+    * trigger-external: Is the trigger an external trigger?
+
+Examples:
+adc0: adc at fffb0000 {
+	compatible = "atmel,at91-adc";
+	reg = <0xfffb0000 0x100>;
+	interrupts = <20 4>;
+	atmel,adc-channel-base = <0x30>;
+	atmel,adc-channels-used = <0xff>;
+	atmel,adc-drdy-mask = <0x10000>;
+	atmel,adc-num-channels = <8>;
+	atmel,adc-startup-time = <40>;
+	atmel,adc-status-register = <0x1c>;
+	atmel,adc-trigger-register = <0x08>;
+	atmel,adc-use-external;
+	atmel,adc-vref = <3300>;
+
+	trigger at 0 {
+		trigger-name = "external-rising";
+		trigger-value = <0x1>;
+		trigger-external;
+	};
+	trigger at 1 {
+		trigger-name = "external-falling";
+		trigger-value = <0x2>;
+		trigger-external;
+	};
+
+	trigger at 2 {
+		trigger-name = "external-any";
+		trigger-value = <0x3>;
+		trigger-external;
+	};
+
+	trigger at 3 {
+		trigger-name = "continuous";
+		trigger-value = <0x6>;
+	};
+};
drivers/iio/adc/at91_adc.c +132 -1

162 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 7/9 Add ADC driver to the at91sam9g45 dtsi

In reply to Maxime Ripard
---
 arch/arm/boot/dts/at91sam9g45.dtsi |   37 ++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm/boot/dts/at91sam9g45.dtsi +37 -0
index c804214..6f0d21e 100644
@@ -199,6 +199,43 @@
 				interrupts = <25 4>;
 				status = "disabled";
 			};
+
+			adc0: adc at fffb0000 {
+				compatible = "atmel,at91sam9g20-adc";
+				reg = <0xfffb0000 0x100>;
+				interrupts = <20 4>;
+				atmel,adc-use-external-triggers;
+				atmel,adc-channels-used = <0xff>;
+				atmel,adc-vref = <3300>;
+				atmel,adc-num-channels = <8>;
+				atmel,adc-startup-time = <40>;
+				atmel,adc-channel-base = <0x30>;
+				atmel,adc-drdy-mask = <0x10000>;
+				atmel,adc-status-register = <0x1c>;
+				atmel,adc-trigger-register = <0x08>;
+
+				trigger at 0 {
+					trigger-name = "external-rising";
+					trigger-value = <0x1>;
+					trigger-external;
+				};
+				trigger at 1 {
+					trigger-name = "external-falling";
+					trigger-value = <0x2>;
+					trigger-external;
+				};
+
+				trigger at 2 {
+					trigger-name = "external-any";
+					trigger-value = <0x3>;
+					trigger-external;
+				};
+
+				trigger at 3 {
+					trigger-name = "continuous";
+					trigger-value = <0x6>;
+				};
+			};
 		};
 
 		nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH 8/9 Add ADC driver to the at91sam9x5 dtsi

In reply to Maxime Ripard
---
 arch/arm/boot/dts/at91sam9x5.dtsi |   38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm/boot/dts/at91sam9x5.dtsi +38 -0
index dd4ed74..03b9eff 100644
@@ -190,6 +190,44 @@
 				interrupts = <27 4>;
 				status = "disabled";
 			};
+
+			adc0: adc at f804c000 {
+				compatible = "atmel,at91-adc";
+				reg = <0xf804c000 0x100>;
+				interrupts = <19 4>;
+				atmel,adc-use-external;
+				atmel,adc-channels-used = <0xffff>;
+				atmel,adc-vref = <3300>;
+				atmel,adc-num-channels = <12>;
+				atmel,adc-startup-time = <40>;
+				atmel,adc-channel-base = <0x50>;
+				atmel,adc-drdy-mask = <0x1000000>;
+				atmel,adc-status-register = <0x30>;
+				atmel,adc-trigger-register = <0xc0>;
+
+				trigger at 0 {
+					trigger-name = "external-rising";
+					trigger-value = <0x1>;
+					trigger-external;
+				};
+
+				trigger at 1 {
+					trigger-name = "external-falling";
+					trigger-value = <0x2>;
+					trigger-external;
+				};
+
+				trigger at 2 {
+					trigger-name = "external-any";
+					trigger-value = <0x3>;
+					trigger-external;
+				};
+
+				trigger at 3 {
+					trigger-name = "continuous";
+					trigger-value = <0x6>;
+				};
+			};
 		};
 
 		nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH 9/9 Add DTSI for the G20 SoC

In reply to Maxime Ripard
---
 arch/arm/boot/dts/at91sam9g20.dtsi |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm/boot/dts/at91sam9g20.dtsi +35 -0
index 773ef48..2b1ad83 100644
@@ -197,6 +197,41 @@
 				interrupts = <10 4>;
 				status = "disabled";
 			};
+
+			adc0: adc at fffe0000 {
+				compatible = "atmel,at91sam9g20-adc";
+				reg = <0xfffe0000 0x100>;
+				interrupts = <5 4>;
+				atmel,adc-use-external-triggers;
+				atmel,adc-channels-used = <0xf>;
+				atmel,adc-vref = <3300>;
+				atmel,adc-num-channels = <4>;
+				atmel,adc-startup-time = <10>;
+				atmel,adc-channel-base = <0x30>;
+				atmel,adc-drdy-mask = <0x10000>;
+				atmel,adc-status-register = <0x1c>;
+				atmel,adc-trigger-register = <0x04>;
+
+				trigger at 0 {
+					trigger-name = "timer-counter-0";
+					trigger-value = <0x1>;
+				};
+				trigger at 1 {
+					trigger-name = "timer-counter-1";
+					trigger-value = <0x3>;
+				};
+
+				trigger at 2 {
+					trigger-name = "timer-counter-2";
+					trigger-value = <0x5>;
+				};
+
+				trigger at 3 {
+					trigger-name = "external";
+					trigger-value = <0x13>;
+					trigger-external;
+				};
+			};
 		};
 
 		nand0: nand at 40000000 {
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

In reply to Maxime Ripard

On 05/09/2012 11:05 AM, Maxime Ripard :

Quoted 10 lines

Hi all,

Here is another version of the patches to bring ADC driver to Atmel boards. Since last version, here is what changed:
* Rebased on top of staging-next to move out of staging. Had to change to IIO kfifo buffer along the way.
* Reworked the DT bindings according to Jean-Christophe reviews
* Made various fixes according to reviews
* Support for X5 boards

Quoted 2 lines

Thanks,
Maxime

Hi Maxime,

Thanks for posting this new series. My overall feeling is that it is very close to an achievement! Apart from some trivial fixes, you can add my :

on the whole series.

Jonathan, Arnd, Olof,

As explained by Maxime, this patch series is adding the Atmel ADC driver to the out-of-staging iio subsystem. It relies on patches that are in staging-next.
On the other hand, I really wouldn't like to split the series between iio and arm-soc...
My question is: would it be possible to take this series in Jonathan iio/staging-next git tree for inclusion in 3.5? Arnd & Olof, is it ok for you? Do you want to add your Acked-by on some patches?

Thanks, best regards,

Signature · 1 line
Nicolas Ferre
#12 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

Quoted 10 lines · Nicolas Ferre

Jonathan, Arnd, Olof,

As explained by Maxime, this patch series is adding the Atmel ADC driver to the out-of-staging iio subsystem. It relies on patches that are in staging-next.
On the other hand, I really wouldn't like to split the series between iio and arm-soc...
My question is: would it be possible to take this series in Jonathan iio/staging-next git tree for inclusion in 3.5? Arnd & Olof, is it ok for you? Do you want to add your Acked-by on some patches?

Hmm, if we would do only the DT-based probing for this, it would be very simple to split the patches between the two branches, but with the dependency on the platform_data definition, we can't do that.

If you think we still need the platform_data, I guess it can go in the iio tree, but I'd be happier if we didn't need it any more.

Arnd

#13 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

In reply to Maxime Ripard
Quoted 7 lines · Maxime Ripard

Here is another version of the patches to bring ADC driver to Atmel boards. Since last version, here is what changed:
* Rebased on top of staging-next to move out of staging. Had to change to IIO kfifo buffer along the way.
* Reworked the DT bindings according to Jean-Christophe reviews
* Made various fixes according to reviews
* Support for X5 boards

What's the reason for providing both DT and non-DT probing in that driver? Doesn't it make more sense to just require that everyone who uses this device boots using the device tree?

Arnd

#14 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

Le 09/05/2012 16:40, Arnd Bergmann a ?crit :

Quoted 9 lines · Maxime Ripard
Quoted 7 lines

Here is another version of the patches to bring ADC driver to Atmel boards. Since last version, here is what changed:
* Rebased on top of staging-next to move out of staging. Had to change to IIO kfifo buffer along the way.
* Reworked the DT bindings according to Jean-Christophe reviews
* Made various fixes according to reviews
* Support for X5 boards

Quoted 3 lines

What's the reason for providing both DT and non-DT probing in that driver? Doesn't it make more sense to just require that everyone who uses this device boots using the device tree?

Mostly historical actually.
The first versions were made using only non-DT probing, and then DT was added, so I didn't remove it.
I've no strong feeling about this however, I believe we can definitely drop it, moreover if it makes life easier for you to merge it.

I'll send an updated version.

Maxime

Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#15 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

On 05/10/2012 10:32 AM, Maxime Ripard :

Quoted 14 lines

Le 09/05/2012 16:40, Arnd Bergmann a ?crit :

Quoted 9 lines · Maxime Ripard
Quoted 7 lines

Here is another version of the patches to bring ADC driver to Atmel boards. Since last version, here is what changed:
* Rebased on top of staging-next to move out of staging. Had to change to IIO kfifo buffer along the way.
* Reworked the DT bindings according to Jean-Christophe reviews
* Made various fixes according to reviews
* Support for X5 boards

Quoted 3 lines

What's the reason for providing both DT and non-DT probing in that driver? Doesn't it make more sense to just require that everyone who uses this device boots using the device tree?

Quoted 7 lines

Mostly historical actually.
The first versions were made using only non-DT probing, and then DT was added, so I didn't remove it.
I've no strong feeling about this however, I believe we can definitely drop it, moreover if it makes life easier for you to merge it.

I'll send an updated version.

Hold on Maxime,

Non-DT is important for us as several boards are not converted to DT and I guess that some never will. Moreover, some AT91 SoC will certainly never be converted to DT but all are equipped with ADC...

So I would really like to keep the non-DT probing. This will give the ability for users to experiment IIO/ADC with whichever kernel revision, whichever AT91 SoC they like.

Arnd, we will have to agree on a way to push this work into mainline, but please consider keeping the non-DT part for this driver.

Best regards,

Signature · 1 line
Nicolas Ferre
#16 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

Quoted 6 lines · Nicolas Ferre

So I would really like to keep the non-DT probing. This will give the ability for users to experiment IIO/ADC with whichever kernel revision, whichever AT91 SoC they like.

Arnd, we will have to agree on a way to push this work into mainline, but please consider keeping the non-DT part for this driver.

Ok. If the non-DT part is important to you, I suggest you merge it all through the IIO tree, to avoid dependency problems with the platform data header file.

Please add my Acked-by for the arch/arm patches.

Arnd

#17 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

Hi Jonathan,

Since everyone seems to have put his Acked-By (Nicolas, Arnd and you), are you ok to merge it in your tree ?

You still had some minor comments, do you you want me to post a new patchset to the mailing list, or a public git branch would be enough ?

Thanks,
Maxime

Le 10/05/2012 15:28, Arnd Bergmann a ?crit :

Quoted 15 lines · Nicolas Ferre
Quoted 6 lines

So I would really like to keep the non-DT probing. This will give the ability for users to experiment IIO/ADC with whichever kernel revision, whichever AT91 SoC they like.

Arnd, we will have to agree on a way to push this work into mainline, but please consider keeping the non-DT part for this driver.

Ok. If the non-DT part is important to you, I suggest you merge it all through the IIO tree, to avoid dependency problems with the platform data header file.

Please add my Acked-by for the arch/arm patches.

Arnd

Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#18 lore raw

PATCH v3 1/1 Add ADC driver for Atmel G20, G45 and X5 boards

Quoted 7 lines · Maxime Ripard

Hi Jonathan,

Since everyone seems to have put his Acked-By (Nicolas, Arnd and you), are you ok to merge it in your tree ?

You still had some minor comments, do you you want me to post a new patchset to the mailing list, or a public git branch would be enough ?

IIO is still in staging from the point of view of git trees. Hence Greg will actually merge the patches. Could you send him a clean set with all the acks etc. (cc'd on this).

Quoted 22 lines

Thanks,
Maxime

Le 10/05/2012 15:28, Arnd Bergmann a ?crit :

Quoted 15 lines · Nicolas Ferre
Quoted 6 lines

So I would really like to keep the non-DT probing. This will give the ability for users to experiment IIO/ADC with whichever kernel revision, whichever AT91 SoC they like.

Arnd, we will have to agree on a way to push this work into mainline, but please consider keeping the non-DT part for this driver.

Ok. If the non-DT part is important to you, I suggest you merge it all through the IIO tree, to avoid dependency problems with the platform data header file.

Please add my Acked-by for the arch/arm patches.

Arnd