Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bone51 & audio cape #18

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4028c98c01d5a5496fe047528173e4ca1018babb Mon Sep 17 00:00:00 2001
From 67f2bb9789a72863d4ad6cf96a597dfcccbbf8dc Mon Sep 17 00:00:00 2001
From: "Patil, Rachna" <[email protected]>
Date: Fri, 28 Jun 2013 00:45:20 +0100
Subject: [PATCH 18/20] input : ti_tsc : Enable shared IRQ TSC
Subject: [PATCH 18/19] input : ti_tsc : Enable shared IRQ TSC

Touchscreen and ADC share the same IRQ line from parent MFD core.
Previously only Touchscreen was interrupt based.
Expand All @@ -13,7 +13,8 @@ Signed-off-by: Patil, Rachna <[email protected]>
Acked-by: Vaibhav Hiremath <[email protected]>
---
drivers/input/touchscreen/ti_am335x_tsc.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
include/linux/mfd/ti_am335x_tscadc.h | 13 ++++++++++++-
2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index f0acdca..8933c91 100644
Expand Down Expand Up @@ -69,6 +70,55 @@ index f0acdca..8933c91 100644
if (err) {
dev_err(&pdev->dev, "failed to allocate irq.\n");
goto err_free_mem;
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index 17c0cba..3a9c00f 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -46,17 +46,23 @@
/* Step Enable */
#define STEPENB_MASK (0x1FFFF << 0)
#define STEPENB(val) ((val) << 0)
+#define ENB(val) (1 << (val))
+#define STPENB_STEPENB STEPENB(0x1FFFF)
+#define STPENB_STEPENB_TC STEPENB(0x1FFF)

/* IRQ enable */
#define IRQENB_HW_PEN BIT(0)
#define IRQENB_FIFO0THRES BIT(2)
#define IRQENB_FIFO1THRES BIT(5)
#define IRQENB_PENUP BIT(9)
+#define IRQENB_FIFO1OVRRUN BIT(6)
+#define IRQENB_FIFO1UNDRFLW BIT(7)

/* Step Configuration */
#define STEPCONFIG_MODE_MASK (3 << 0)
#define STEPCONFIG_MODE(val) ((val) << 0)
#define STEPCONFIG_MODE_HWSYNC STEPCONFIG_MODE(2)
+#define STEPCONFIG_MODE_SWCNT STEPCONFIG_MODE(1)
#define STEPCONFIG_AVG_MASK (7 << 2)
#define STEPCONFIG_AVG(val) ((val) << 2)
#define STEPCONFIG_AVG_16 STEPCONFIG_AVG(4)
@@ -124,7 +130,8 @@
#define MAX_CLK_DIV 7
#define TOTAL_STEPS 16
#define TOTAL_CHANNELS 8
-
+#define FIFO1_THRESHOLD 19
+#define FIFO_SIZE 64
/*
* ADC runs at 3MHz, and it takes
* 15 cycles to latch one data output.
@@ -159,6 +166,10 @@ struct ti_tscadc_dev {

/* adc device */
struct adc_device *adc;
+
+ /* Context save */
+ unsigned int irqstat;
+ unsigned int ctrl;
};

static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
--
1.8.2.1
1.9.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 83413d509a620b48c06aa6fe04cd038916614554 Mon Sep 17 00:00:00 2001
From 616716a527a6e9393e0aed38a48ed342bb67e407 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <[email protected]>
Date: Sat, 27 Jul 2013 13:06:21 +0100
Subject: [PATCH 20/20] iio: ti_am335x_adc: Add IIO map interface
Subject: [PATCH 19/19] iio: ti_am335x_adc: Add IIO map interface

Add an IIO map interface that consumers can use.

Expand All @@ -12,18 +12,18 @@ Signed-off-by: Zubair Lutfullah <[email protected]>
1 file changed, 45 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index d626508..a172dfb 100644
index f78d2c1..c380142 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -38,6 +38,7 @@
@@ -33,6 +33,7 @@
struct tiadc_device {
struct ti_tscadc_dev *mfd_tscadc;
int channels;
+ struct iio_map *map;
u8 channel_line[8];
u8 channel_step[8];
struct work_struct poll_work;
@@ -300,13 +301,16 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)
};
@@ -105,13 +106,16 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)
struct tiadc_device *adc_dev = iio_priv(indio_dev);
struct iio_chan_spec *chan_array;
struct iio_chan_spec *chan;
Expand All @@ -43,10 +43,10 @@ index d626508..a172dfb 100644

chan = chan_array;
for (i = 0; i < channels; i++, chan++) {
@@ -323,12 +327,44 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)
}
@@ -128,12 +132,44 @@ static int tiadc_channel_init(struct iio_dev *indio_dev, int channels)

indio_dev->channels = chan_array;

+
+ map = kcalloc(channels + 1, sizeof(struct iio_map), GFP_KERNEL);
+ if (map == NULL) {
Expand Down Expand Up @@ -88,8 +88,8 @@ index d626508..a172dfb 100644
}

static int tiadc_read_raw(struct iio_dev *indio_dev,
@@ -436,8 +472,10 @@ static int tiadc_probe(struct platform_device *pdev)
tiadc_writel(adc_dev, REG_FIFO1THR, FIFO1_THRESHOLD);
@@ -246,12 +282,16 @@ static int tiadc_probe(struct platform_device *pdev)
tiadc_step_config(adc_dev);

err = tiadc_channel_init(indio_dev, adc_dev->channels);
- if (err < 0)
Expand All @@ -98,11 +98,6 @@ index d626508..a172dfb 100644
goto err_free_device;
+ }

INIT_WORK(&adc_dev->poll_work, &tiadc_adc_work);
init_waitqueue_head(&adc_dev->wq_data_avail);
@@ -453,8 +491,10 @@ static int tiadc_probe(struct platform_device *pdev)
goto err_unregister;

err = iio_device_register(indio_dev);
- if (err)
+ if (err) {
Expand All @@ -113,5 +108,5 @@ index d626508..a172dfb 100644
platform_set_drvdata(pdev, indio_dev);

--
1.8.2.1
1.9.2

Loading