linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add support for ADC on am437x-gp and am43x-epos-evm
@ 2014-11-21 10:14 Vignesh R
  2014-11-21 10:14 ` [PATCH v3 1/2] ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx Vignesh R
  2014-11-21 10:14 ` [PATCH v3 2/2] ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm Vignesh R
  0 siblings, 2 replies; 5+ messages in thread
From: Vignesh R @ 2014-11-21 10:14 UTC (permalink / raw)
  To: Paul Walmsley, Benoit Cousson, Tony Lindgren, Rob Herring, Pawel Moll
  Cc: Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-omap,
	devicetree, linux-arm-kernel, linux-kernel, Vignesh R

This series of patches enable ADC on am437x-gp-evm and am43x-epos-evm.
tscadc DT node has been added to am437x-gp and am43x-epos DT files.
With these patches, ADC functionalities are now available on am43xx.

Change log:

v3:
Add ADC hwmod data to AM43xx hwmod file instead
of sharing hwmod structures betweem AM33xx and
AM43xx.

v2:
Removed phy addresses in hwmod. Using DT instead.
Removed unused "ti,am4372" compatible string.
Use macro to set clk domain name.
Fixed subject format of all patches


Vignesh R (2):
  ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx
  ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and
    am43x-epos-evm

 arch/arm/boot/dts/am4372.dtsi              | 20 +++++++++++++++
 arch/arm/boot/dts/am437x-gp-evm.dts        |  8 ++++++
 arch/arm/boot/dts/am43x-epos-evm.dts       |  8 ++++++
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 39 ++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx
  2014-11-21 10:14 [PATCH v3 0/2] Add support for ADC on am437x-gp and am43x-epos-evm Vignesh R
@ 2014-11-21 10:14 ` Vignesh R
  2014-11-21 17:38   ` Paul Walmsley
  2014-11-21 10:14 ` [PATCH v3 2/2] ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm Vignesh R
  1 sibling, 1 reply; 5+ messages in thread
From: Vignesh R @ 2014-11-21 10:14 UTC (permalink / raw)
  To: Paul Walmsley, Benoit Cousson, Tony Lindgren, Rob Herring, Pawel Moll
  Cc: Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-omap,
	devicetree, linux-arm-kernel, linux-kernel, Vignesh R

This patch adds hwmod support for ADC on AM43xx. Since clockdomain
and offsets of adc_tsc are different from AM33xx, ADC data has been
directly added to AM43xx hwmod file.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_43xx_data.c | 39 ++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index fea01aa3ef42..b47f6ad0928c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -417,6 +417,37 @@ static struct omap_hwmod am43xx_qspi_hwmod = {
 	},
 };
 
+/*
+ * 'adc/tsc' class
+ * TouchScreen Controller (Anolog-To-Digital Converter)
+ */
+static struct omap_hwmod_class_sysconfig am43xx_adc_tsc_sysc = {
+	.rev_offs       = 0x00,
+	.sysc_offs      = 0x10,
+	.sysc_flags     = SYSC_HAS_SIDLEMODE,
+	.idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+			  SIDLE_SMART_WKUP),
+	.sysc_fields    = &omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class am43xx_adc_tsc_hwmod_class = {
+	.name           = "adc_tsc",
+	.sysc           = &am43xx_adc_tsc_sysc,
+};
+
+static struct omap_hwmod am43xx_adc_tsc_hwmod = {
+	.name           = "adc_tsc",
+	.class          = &am43xx_adc_tsc_hwmod_class,
+	.clkdm_name     = "l3s_tsc_clkdm",
+	.main_clk       = "adc_tsc_fck",
+	.prcm           = {
+		.omap4  = {
+			.clkctrl_offs   = AM43XX_CM_WKUP_ADC_TSC_CLKCTRL_OFFSET,
+			.modulemode     = MODULEMODE_SWCTRL,
+		},
+	},
+};
+
 /* dss */
 
 static struct omap_hwmod am43xx_dss_core_hwmod = {
@@ -547,6 +578,13 @@ static struct omap_hwmod_ocp_if am43xx_l4_wkup__gpio0 = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+static struct omap_hwmod_ocp_if am43xx_l4_wkup__adc_tsc = {
+	.master         = &am33xx_l4_wkup_hwmod,
+	.slave          = &am43xx_adc_tsc_hwmod,
+	.clk            = "dpll_core_m4_div2_ck",
+	.user           = OCP_USER_MPU,
+};
+
 static struct omap_hwmod_ocp_if am43xx_l4_hs__cpgmac0 = {
 	.master		= &am43xx_l4_hs_hwmod,
 	.slave		= &am33xx_cpgmac0_hwmod,
@@ -789,6 +827,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
 	&am43xx_l4_wkup__i2c1,
 	&am43xx_l4_wkup__gpio0,
 	&am43xx_l4_wkup__wd_timer1,
+	&am43xx_l4_wkup__adc_tsc,
 	&am43xx_l3_s__qspi,
 	&am33xx_l4_per__dcan0,
 	&am33xx_l4_per__dcan1,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm
  2014-11-21 10:14 [PATCH v3 0/2] Add support for ADC on am437x-gp and am43x-epos-evm Vignesh R
  2014-11-21 10:14 ` [PATCH v3 1/2] ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx Vignesh R
@ 2014-11-21 10:14 ` Vignesh R
  2014-11-22  0:25   ` Tony Lindgren
  1 sibling, 1 reply; 5+ messages in thread
From: Vignesh R @ 2014-11-21 10:14 UTC (permalink / raw)
  To: Paul Walmsley, Benoit Cousson, Tony Lindgren, Rob Herring, Pawel Moll
  Cc: Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-omap,
	devicetree, linux-arm-kernel, linux-kernel, Vignesh R

This patch adds tscadc DT entries for am437x-gp-evm
and am43x-epos-evm.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 arch/arm/boot/dts/am4372.dtsi        | 20 ++++++++++++++++++++
 arch/arm/boot/dts/am437x-gp-evm.dts  |  8 ++++++++
 arch/arm/boot/dts/am43x-epos-evm.dts |  8 ++++++++
 3 files changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 46660ffd2b65..cb73e5eb6971 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -667,6 +667,26 @@
 			};
 		};
 
+		tscadc: tscadc@44e0d000 {
+			compatible = "ti,am3359-tscadc";
+			reg = <0x44e0d000 0x1000>;
+			ti,hwmods = "adc_tsc";
+			interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&adc_tsc_fck>;
+			clock-names = "fck";
+			status = "disabled";
+
+			tsc {
+				compatible = "ti,am3359-tsc";
+			};
+
+			adc {
+				#io-channel-cells = <1>;
+				compatible = "ti,am3359-adc";
+			};
+
+		};
+
 		sham: sham@53100000 {
 			compatible = "ti,omap5-sham";
 			ti,hwmods = "sham";
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
index a521ac0a7d5a..7553bb7b2ca9 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -343,6 +343,14 @@
 	status = "okay";
 };
 
+&tscadc {
+	status = "okay";
+
+	adc {
+		ti,adc-channels = <0 1 2 3 4 5 6 7>;
+	};
+};
+
 &ecap0 {
 	status = "okay";
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
index f7e9bba10bd6..2ac693fd51da 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -519,6 +519,14 @@
 	status = "okay";
 };
 
+&tscadc {
+	status = "okay";
+
+	adc {
+		ti,adc-channels = <0 1 2 3 4 5 6 7>;
+	};
+};
+
 &ecap0 {
 		status = "okay";
 		pinctrl-names = "default";
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx
  2014-11-21 10:14 ` [PATCH v3 1/2] ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx Vignesh R
@ 2014-11-21 17:38   ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2014-11-21 17:38 UTC (permalink / raw)
  To: Vignesh R
  Cc: Benoit Cousson, Tony Lindgren, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-omap,
	devicetree, linux-arm-kernel, linux-kernel

On Fri, 21 Nov 2014, Vignesh R wrote:

> This patch adds hwmod support for ADC on AM43xx. Since clockdomain
> and offsets of adc_tsc are different from AM33xx, ADC data has been
> directly added to AM43xx hwmod file.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>

Thanks, will try to queue this for v3.19.  Will update my previous pull 
request.  Otherwise it's v3.20 material.

Note that I cannot test this patch locally due to the lack of an AM43xx 
board.


- Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm
  2014-11-21 10:14 ` [PATCH v3 2/2] ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm Vignesh R
@ 2014-11-22  0:25   ` Tony Lindgren
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2014-11-22  0:25 UTC (permalink / raw)
  To: Vignesh R
  Cc: Paul Walmsley, Benoit Cousson, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala, Russell King, linux-omap,
	devicetree, linux-arm-kernel, linux-kernel

* Vignesh R <vigneshr@ti.com> [141121 02:18]:
> This patch adds tscadc DT entries for am437x-gp-evm
> and am43x-epos-evm.

Applying into omap-for-v3.19/dt-v2 thanks.

Tony

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-22  0:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-21 10:14 [PATCH v3 0/2] Add support for ADC on am437x-gp and am43x-epos-evm Vignesh R
2014-11-21 10:14 ` [PATCH v3 1/2] ARM: OMAP2+: hwmod: AM43x: add hwmod support for ADC on AM43xx Vignesh R
2014-11-21 17:38   ` Paul Walmsley
2014-11-21 10:14 ` [PATCH v3 2/2] ARM: dts: AM43xx: add tscadc DT entries for am437x-evm and am43x-epos-evm Vignesh R
2014-11-22  0:25   ` Tony Lindgren

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).