Skip to contentSkip to conversation

ARM: tegra: enable ALS and proximity sensors

PATCH Applied Laxman Dewangan 4 participants 16 messages Apr 23, 2012 – Apr 26, 2012

Subsystems (8)
lore
Share & tools
lore

Laxman Dewangan

author maintainer
#0 lore raw

v2 cover ARM: tegra: enable ALS and proximity sensors

Tegra based platform are using the Intersil's ALS and proximity sensor ISL29018 and ISL29028.
Enabling this sensor in Tegra based platform through device tree. Following changes are done:
- Add vendor prefix for Intersil Corporation in document.
- Change the vendor prefix in driver to reflect as per document.
- Enable the instance of the sensor in Tegra platform ventana, seaboard and cardhu.

Changes from V1:
- Change the vendor prefix for Intersil to "isil".
- Added irq numbers when enabling driver in dts file.

Laxman Dewangan (4):
devicetree: Document Intersil Corporation vendor prefix
staging: iio: light: of: Fix vendor prefix of isl29018/isl29028
ARM: dt: tegra: enable als and proximity sensor
ARM: tegra: defconfig: add ISL29028

 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 arch/arm/boot/dts/tegra-cardhu.dts                 |    8 ++++++++
 arch/arm/boot/dts/tegra-seaboard.dts               |    8 ++++++++
 arch/arm/boot/dts/tegra-ventana.dts                |    8 ++++++++
 arch/arm/configs/tegra_defconfig                   |    1 +
 drivers/staging/iio/light/isl29018.c               |    2 +-
 drivers/staging/iio/light/isl29028.c               |    2 +-
 7 files changed, 28 insertions(+), 2 deletions(-)
author maintainer
#1 lore raw

PATCH v2 1/4 devicetree: Document Intersil Corporation vendor prefix

---
Changes from V1:
- Change the vendor prefix for Intersil Corporation to "isil".

 .../devicetree/bindings/vendor-prefixes.txt        |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 107d8ad..5c78eb2 100644
@@ -23,6 +23,7 @@ hp	Hewlett Packard
 ibm	International Business Machines (IBM)
 idt	Integrated Device Technologies, Inc.
 intercontrol	Inter Control Group
+isil	Intersil Corporation
 linux	Linux-specific binding
 marvell	Marvell Technology Group Ltd.
 maxim	Maxim Integrated Products
Signature · 1 line
1.7.1.1
#2 lore raw

Re: [PATCH V2 1/4] devicetree: Document Intersil Corporation vendor prefix

Quoted 1 line · Laxman Dewangan

I assume this patch will go through the devictree git tree. Grant/Rob, let me know if you want me to take it through the Tegra tree.

#3 lore raw

Re: [PATCH V2 1/4] devicetree: Document Intersil Corporation vendor prefix

Quoted 6 lines · Stephen Warren
Quoted 1 line · Laxman Dewangan

I assume this patch will go through the devictree git tree. Grant/Rob, let me know if you want me to take it through the Tegra tree.

Device tree seems reasonable to me.

Rob

Signature · 2 lines
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.
author maintainer
#4 lore raw

PATCH v5 1/1 dmaengine: tegra: add dma driver

In reply to Laxman Dewangan

Adding dmaengine based NVIDIA's Tegra APB dma driver. This driver support the slave mode of data transfer from peripheral to memory and vice versa.
The driver supports for the cyclic and non-cyclic mode of data transfer.

---
Got initial comment from community on patch V1.
- Based on that, get rid of the tegra_dma.h header and move require parameter in dma_slave_config of dmaengine.h.
- Change the desc allocation technique, allocating one by one.
- Corrected some typo.
- Already cover most of Stephen comments but final review was pending.
- Sending this patch for internal review again so that we will not loose any comments.

 drivers/dma/Kconfig       |   14 +
 drivers/dma/Makefile      |    1 +
 drivers/dma/tegra_dma.c   | 1773 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/dmaengine.h |    4 +
 4 files changed, 1792 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dma/tegra_dma.c
drivers/dma/Kconfig +14 -0
index ef378b5..611b10f 100644
@@ -148,6 +148,20 @@ config TXX9_DMAC
 	  Support the TXx9 SoC internal DMA controller.  This can be
 	  integrated in chips such as the Toshiba TX4927/38/39.
 
+config TEGRA_DMA
+	bool "NVIDIA Tegra DMA support"
+	depends on ARCH_TEGRA
+	select DMA_ENGINE
+	select REGMAP_MMIO
+	help
+	  Support for the NVIDIA Tegra DMA controller driver. The dma
+	  controller is having multiple dma channel which can be configured
+	  for different peripherals like audio, UART, SPI, I2C etc which is
+	  in APB bus.
+	  This dma controller transfers data from memory to peripheral fifo
+	  address or vice versa. It does not support memory to memory data
+	  transfer.
+
 config SH_DMAE
 	tristate "Renesas SuperH DMAC support"
 	depends on (SUPERH && SH_DMA) || (ARM && ARCH_SHMOBILE)
drivers/dma/Makefile +1 -0
index 86b795b..3aaa63a 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_MXS_DMA) += mxs-dma.o
 obj-$(CONFIG_TIMB_DMA) += timb_dma.o
 obj-$(CONFIG_SIRF_DMA) += sirf-dma.o
 obj-$(CONFIG_STE_DMA40) += ste_dma40.o ste_dma40_ll.o
+obj-$(CONFIG_TEGRA_DMA) += tegra_dma.o
 obj-$(CONFIG_PL330_DMA) += pl330.o
 obj-$(CONFIG_PCH_DMA) += pch_dma.o
 obj-$(CONFIG_AMBA_PL08X) += amba-pl08x.o
drivers/dma/tegra_dma.c new file +1773 -0

1,773 lines not on this page · raw message

include/linux/dmaengine.h +4 -0
index 1082698..b0b275f 100644
@@ -338,6 +338,9 @@ enum dma_slave_buswidth {
  * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill
  * with 'true' if peripheral should be flow controller. Direction will be
  * selected at Runtime.
+ * @slave_id: Slave requester id. Only valid for slave channels. The dma
+ * slave peripheral will have unique id as dma requester which need to be
+ * pass as slave config.
  *
  * This struct is passed in as configuration data to a DMA engine
  * in order to set up a certain channel for DMA transport at runtime.
@@ -365,6 +368,7 @@ struct dma_slave_config {
 	u32 src_maxburst;
 	u32 dst_maxburst;
 	bool device_fc;
+	int slave_id;
 };
 
 static inline const char *dma_chan_name(struct dma_chan *chan)
Signature · 1 line
1.7.1.1
author maintainer
#5 lore raw

PATCH v2 2/4 staging: iio: light: of: Fix vendor prefix of isl29018/isl29028

In reply to Laxman Dewangan

ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity.

---
Changes from V1:
- Vendor prefix is now "isil"

 drivers/staging/iio/light/isl29018.c |    2 +-
 drivers/staging/iio/light/isl29028.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/iio/light/isl29018.c +1 -1
index 073e899..1ec2dac 100644
@@ -596,7 +596,7 @@ static const struct i2c_device_id isl29018_id[] = {
 MODULE_DEVICE_TABLE(i2c, isl29018_id);
 
 static const struct of_device_id isl29018_of_match[] = {
-	{ .compatible = "invn,isl29018", },
+	{ .compatible = "isil,isl29018", },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, isl29018_of_match);
drivers/staging/iio/light/isl29028.c +1 -1
index 4ac49aa..7057d9b 100644
@@ -542,7 +542,7 @@ static const struct i2c_device_id isl29028_id[] = {
 MODULE_DEVICE_TABLE(i2c, isl29028_id);
 
 static const struct of_device_id isl29028_of_match[] = {
-	{ .compatible = "isl,isl29028", },
+	{ .compatible = "isil,isl29028", },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, isl29028_of_match);
Signature · 1 line
1.7.1.1
#6 lore raw

Re: [PATCH V2 2/4] staging: iio: light: of: Fix vendor prefix of isl29018/isl29028

Quoted 4 lines · Laxman Dewangan

ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity.

I assume this patch will go through the staging tree. Let me know if you want me to take it through the Tegra tree.

maintainer Acked-by
#7 lore raw

Re: [PATCH V2 2/4] staging: iio: light: of: Fix vendor prefix of isl29018/isl29028

Quoted 8 lines · Stephen Warren
Quoted 4 lines · Laxman Dewangan

ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity.

I assume this patch will go through the staging tree. Let me know if you want me to take it through the Tegra tree.

Please take it through the Tegra tree, it is probably easier overall that way:

#8 lore raw

Re: [PATCH V2 2/4] staging: iio: light: of: Fix vendor prefix of isl29018/isl29028

Quoted 5 lines · Greg KH
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Laxman Dewangan

ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I assume this patch will go through the staging tree. Let me know if you want me to take it through the Tegra tree.

Please take it through the Tegra tree, it is probably easier overall that way:

Sorry, looking harder, this patch touches a file that's added in the current staging tree, so I can't take this patch.

There aren't any dependencies between this patch and the others due to the way I2C probing works (the OF vendor prefix ends up getting ignored), so I think merging it into staging should be simple.

maintainer
#9 lore raw

Re: [PATCH V2 2/4] staging: iio: light: of: Fix vendor prefix of isl29018/isl29028

Quoted 15 lines · Stephen Warren
Quoted 5 lines · Greg KH
Quoted 4 lines · Stephen Warren
Quoted 3 lines · Laxman Dewangan

ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I assume this patch will go through the staging tree. Let me know if you want me to take it through the Tegra tree.

Please take it through the Tegra tree, it is probably easier overall that way:

Quoted 6 lines

Sorry, looking harder, this patch touches a file that's added in the current staging tree, so I can't take this patch.

There aren't any dependencies between this patch and the others due to the way I2C probing works (the OF vendor prefix ends up getting ignored), so I think merging it into staging should be simple.

Ok, I'll do that, Laxman, can you resend it to me?

thanks,

greg k-h

author maintainer
#10 lore raw

Re: [PATCH V2 2/4] staging: iio: light: of: Fix vendor prefix of isl29018/isl29028

Quoted 13 lines · Greg KH
Quoted 12 lines · Stephen Warren
Quoted 11 lines · Greg KH
Quoted 7 lines · Stephen Warren
Quoted 4 lines · Laxman Dewangan

ISL29018/ISL29028 is from Intersil Corporation and making the vendor prefix for this part as "isil" for OF compatibity.

I assume this patch will go through the staging tree. Let me know if you want me to take it through the Tegra tree.

Please take it through the Tegra tree, it is probably easier overall that way:

Quoted 8 lines
Quoted 6 lines

Sorry, looking harder, this patch touches a file that's added in the current staging tree, so I can't take this patch.

There aren't any dependencies between this patch and the others due to the way I2C probing works (the OF vendor prefix ends up getting ignored), so I think merging it into staging should be simple.

Ok, I'll do that, Laxman, can you resend it to me?

Resend the patch. Removed the 2/4 in subject to remove dependency as it can go independently.

Thanks,
Laxman

author maintainer
#11 lore raw

PATCH v2 3/4 ARM: dt: tegra: enable als and proximity sensor

In reply to Laxman Dewangan

Add the device info for ALS and proximity sensor for tegra boards cardhu, ventana and seabridge.

---
Changes from V1:
- remove labels.
- added interrupt numbers.

 arch/arm/boot/dts/tegra-cardhu.dts   |    8 ++++++++
 arch/arm/boot/dts/tegra-seaboard.dts |    8 ++++++++
 arch/arm/boot/dts/tegra-ventana.dts  |    8 ++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/boot/dts/tegra-cardhu.dts +8 -0
index ab8d901..facb950 100644
@@ -93,6 +93,14 @@
 
 	i2c@7000c500 {
 		clock-frequency = <100000>;
+
+		/* ALS and Proximity sensor */
+		isl29028@44 {
+			compatible = "isil,isl29028";
+			reg = <0x44>;
+			interrupt-parent = <&gpio>;
+			interrupts = <88 0x04>; /*gpio PL0 */
+		};
 	};
 
 	i2c@7000c700 {
arch/arm/boot/dts/tegra-seaboard.dts +8 -0
index ed0a2f5..a114183 100644
@@ -270,6 +270,14 @@
 			micdet-delay = <100>;
 			gpio-cfg = < 0xffffffff 0xffffffff 0 0xffffffff 0xffffffff >;
 		};
+
+		/* ALS and proximity sensor */
+		isl29018@44 {
+			compatible = "isil,isl29018";
+			reg = <0x44>;
+			interrupt-parent = <&gpio>;
+			interrupts = < 202 0x04 >; /* GPIO PZ02 */
+		};
 	};
 
 	i2c@7000c400 {
arch/arm/boot/dts/tegra-ventana.dts +8 -0
index bd074cf..6ea41df 100644
@@ -256,6 +256,14 @@
 			micdet-delay = <100>;
 			gpio-cfg = < 0xffffffff 0xffffffff 0 0xffffffff 0xffffffff >;
 		};
+
+		/* ALS and proximity sensor */
+		isl29018@44 {
+			compatible = "isil,isl29018";
+			reg = <0x44>;
+			interrupt-parent = <&gpio>;
+			interrupts = <202 0x04>; /*gpio PZ02 */
+		};
 	};
 
 	i2c@7000c400 {
Signature · 1 line
1.7.1.1
#12 lore raw

Re: [PATCH V2 3/4] ARM: dt: tegra: enable als and proximity sensor

Quoted 4 lines · Laxman Dewangan

Add the device info for ALS and proximity sensor for tegra boards cardhu, ventana and seabridge.

Thanks, applied.

I made the following minor changes: s/PZ02/PZ2/ in .dts files, s/seabridge/seaboard/ in commit description

I note that the proximity detection doesn't appear to work on my Cardhu, although the light sensor works. Is that expected? Both work on Seaboard and Ventana.

author maintainer
#13 lore raw

Re: [PATCH V2 3/4] ARM: dt: tegra: enable als and proximity sensor

Quoted 5 lines · Stephen Warren
Quoted 4 lines · Laxman Dewangan

Add the device info for ALS and proximity sensor for tegra boards cardhu, ventana and seabridge.

Quoted 8 lines

Thanks, applied.

I made the following minor changes: s/PZ02/PZ2/ in .dts files, s/seabridge/seaboard/ in commit description

I note that the proximity detection doesn't appear to work on my Cardhu, although the light sensor works. Is that expected? Both work on Seaboard and Ventana.

Yes, there is problem in cardhu about component mounting for ir led. This is fixed on other version of reference board. So on cardhu, proximity sensing always return 0xFF.

author maintainer
#14 lore raw

PATCH v2 4/4 ARM: tegra: defconfig: add ISL29028

In reply to Laxman Dewangan

The ISL29028 is ALS and proximity sensor and used in tegra cardhu.

---
Changes from V1:
- No change.

 arch/arm/configs/tegra_defconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/configs/tegra_defconfig +1 -0
index 66c2dce..99c3e66 100644
@@ -138,6 +138,7 @@ CONFIG_RTC_DRV_TEGRA=y
 CONFIG_STAGING=y
 CONFIG_IIO=y
 CONFIG_SENSORS_ISL29018=y
+CONFIG_SENSORS_ISL29028=y
 CONFIG_SENSORS_AK8975=y
 CONFIG_MFD_NVEC=y
 CONFIG_KEYBOARD_NVEC=y
Signature · 1 line
1.7.1.1
#15 lore raw

Re: [PATCH V2 4/4] ARM: tegra: defconfig: add ISL29028

Quoted 4 lines · Laxman Dewangan

The ISL29028 is ALS and proximity sensor and used in tegra cardhu.

Thanks, applied.

Note that I squashed it into the existing defconfig update commit to avoid too many commits touching that file.