* [PATCHv4 0/7] Convert twl4030-madc to IIO API and add DT support
@ 2014-03-16 1:43 ` Sebastian Reichel
0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
Hi,
This is PATCHv4 for converting twl4030-madc to the IIO API and
adding DT support. The plan is to remove the private twl4030-madc
API once all users have been removed or converted to the IIO API.
The patchset compiles and has been tested on my Nokia N900.
Changes since PATCHv3 [0]:
* Dropped the following patches (applied in iio tree)
- iio: documentation: Add ABI documentation for *_mean_raw
- iio: inkern: add iio_read_channel_average_raw
* Added some more Acked-by from Jonathan Cameron
- one of them on the basis of "Reorder that and I'm happy".
* Changed some minor stuff requested by Jonathan
- reorder cleanup calls in driver's remove function
- convert another comment to kerneldoc
Status:
* Only feedback from DT binding maintainers is missing.
side note: The binding & the corresponding binding documentation
patch has not changed since 2014-02-13. So depending on when the
time frame starts the three weeks are over already ;)
* It would be nice to see this patchset in 3.15.
[0] https://lkml.org/lkml/2014/3/10/727
-- Sebastian
Sebastian Reichel (7):
mfd: twl4030-madc: Use managed resources
mfd: twl4030-madc: Add DT support and convert to IIO framework
mfd: twl4030-madc: Cleanup driver
mfd: twl-core: Add twl_i2c_read/write_u16
mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
Documentation: DT: Document twl4030-madc binding
mfd: twl4030-madc: Move driver to drivers/iio/adc
.../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++
drivers/iio/adc/Kconfig | 10 +
drivers/iio/adc/Makefile | 1 +
drivers/{mfd => iio/adc}/twl4030-madc.c | 320 +++++++++++++--------
drivers/mfd/Kconfig | 10 -
drivers/mfd/Makefile | 1 -
include/linux/i2c/twl.h | 12 +
include/linux/i2c/twl4030-madc.h | 2 +-
8 files changed, 247 insertions(+), 133 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
rename drivers/{mfd => iio/adc}/twl4030-madc.c (74%)
--
1.9.0
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCHv4 0/7] Convert twl4030-madc to IIO API and add DT support
@ 2014-03-16 1:43 ` Sebastian Reichel
0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA, Sebastian Reichel
Hi,
This is PATCHv4 for converting twl4030-madc to the IIO API and
adding DT support. The plan is to remove the private twl4030-madc
API once all users have been removed or converted to the IIO API.
The patchset compiles and has been tested on my Nokia N900.
Changes since PATCHv3 [0]:
* Dropped the following patches (applied in iio tree)
- iio: documentation: Add ABI documentation for *_mean_raw
- iio: inkern: add iio_read_channel_average_raw
* Added some more Acked-by from Jonathan Cameron
- one of them on the basis of "Reorder that and I'm happy".
* Changed some minor stuff requested by Jonathan
- reorder cleanup calls in driver's remove function
- convert another comment to kerneldoc
Status:
* Only feedback from DT binding maintainers is missing.
side note: The binding & the corresponding binding documentation
patch has not changed since 2014-02-13. So depending on when the
time frame starts the three weeks are over already ;)
* It would be nice to see this patchset in 3.15.
[0] https://lkml.org/lkml/2014/3/10/727
-- Sebastian
Sebastian Reichel (7):
mfd: twl4030-madc: Use managed resources
mfd: twl4030-madc: Add DT support and convert to IIO framework
mfd: twl4030-madc: Cleanup driver
mfd: twl-core: Add twl_i2c_read/write_u16
mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
Documentation: DT: Document twl4030-madc binding
mfd: twl4030-madc: Move driver to drivers/iio/adc
.../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++
drivers/iio/adc/Kconfig | 10 +
drivers/iio/adc/Makefile | 1 +
drivers/{mfd => iio/adc}/twl4030-madc.c | 320 +++++++++++++--------
drivers/mfd/Kconfig | 10 -
drivers/mfd/Makefile | 1 -
include/linux/i2c/twl.h | 12 +
include/linux/i2c/twl4030-madc.h | 2 +-
8 files changed, 247 insertions(+), 133 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
rename drivers/{mfd => iio/adc}/twl4030-madc.c (74%)
--
1.9.0
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCHv4 1/7] mfd: twl4030-madc: Use managed resources
2014-03-16 1:43 ` Sebastian Reichel
(?)
@ 2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 7:59 ` Lee Jones
-1 siblings, 1 reply; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
Update twl4030-madc driver to use managed resources.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: Marek Belisko <marek@goldelico.com>
---
drivers/mfd/twl4030-madc.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index 4c583e4..5458561 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -702,14 +702,14 @@ static int twl4030_madc_probe(struct platform_device *pdev)
{
struct twl4030_madc_data *madc;
struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev);
- int ret;
+ int irq, ret;
u8 regval;
if (!pdata) {
dev_err(&pdev->dev, "platform_data not available\n");
return -EINVAL;
}
- madc = kzalloc(sizeof(*madc), GFP_KERNEL);
+ madc = devm_kzalloc(&pdev->dev, sizeof(*madc), GFP_KERNEL);
if (!madc)
return -ENOMEM;
@@ -726,7 +726,7 @@ static int twl4030_madc_probe(struct platform_device *pdev)
TWL4030_MADC_ISR1 : TWL4030_MADC_ISR2;
ret = twl4030_madc_set_power(madc, 1);
if (ret < 0)
- goto err_power;
+ return ret;
ret = twl4030_madc_set_current_generator(madc, 0, 1);
if (ret < 0)
goto err_current_generator;
@@ -770,7 +770,9 @@ static int twl4030_madc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, madc);
mutex_init(&madc->lock);
- ret = request_threaded_irq(platform_get_irq(pdev, 0), NULL,
+
+ irq = platform_get_irq(pdev, 0);
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
twl4030_madc_threaded_irq_handler,
IRQF_TRIGGER_RISING, "twl4030_madc", madc);
if (ret) {
@@ -783,9 +785,6 @@ err_i2c:
twl4030_madc_set_current_generator(madc, 0, 0);
err_current_generator:
twl4030_madc_set_power(madc, 0);
-err_power:
- kfree(madc);
-
return ret;
}
@@ -793,10 +792,8 @@ static int twl4030_madc_remove(struct platform_device *pdev)
{
struct twl4030_madc_data *madc = platform_get_drvdata(pdev);
- free_irq(platform_get_irq(pdev, 0), madc);
twl4030_madc_set_current_generator(madc, 0, 0);
twl4030_madc_set_power(madc, 0);
- kfree(madc);
return 0;
}
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 2/7] mfd: twl4030-madc: Add DT support and convert to IIO framework
2014-03-16 1:43 ` Sebastian Reichel
(?)
(?)
@ 2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 8:00 ` Lee Jones
-1 siblings, 1 reply; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
This converts twl4030-madc module to use the Industrial IO ADC
framework and adds device tree support.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Tested-by: Marek Belisko <marek@goldelico.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/mfd/twl4030-madc.c | 127 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 116 insertions(+), 11 deletions(-)
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index 5458561..93ef912 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -47,11 +47,14 @@
#include <linux/gfp.h>
#include <linux/err.h>
+#include <linux/iio/iio.h>
+
/*
* struct twl4030_madc_data - a container for madc info
* @dev - pointer to device structure for madc
* @lock - mutex protecting this data structure
* @requests - Array of request struct corresponding to SW1, SW2 and RT
+ * @use_second_irq - IRQ selection (main or co-processor)
* @imr - Interrupt mask register of MADC
* @isr - Interrupt status register of MADC
*/
@@ -59,10 +62,71 @@ struct twl4030_madc_data {
struct device *dev;
struct mutex lock; /* mutex protecting this data structure */
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
+ bool use_second_irq;
int imr;
int isr;
};
+static int twl4030_madc_read(struct iio_dev *iio_dev,
+ const struct iio_chan_spec *chan,
+ int *val, int *val2, long mask)
+{
+ struct twl4030_madc_data *madc = iio_priv(iio_dev);
+ struct twl4030_madc_request req;
+ int ret;
+
+ req.method = madc->use_second_irq ? TWL4030_MADC_SW2 : TWL4030_MADC_SW1;
+
+ req.channels = BIT(chan->channel);
+ req.active = false;
+ req.func_cb = NULL;
+ req.type = TWL4030_MADC_WAIT;
+ req.raw = !(mask == IIO_CHAN_INFO_PROCESSED);
+ req.do_avg = (mask == IIO_CHAN_INFO_AVERAGE_RAW);
+
+ ret = twl4030_madc_conversion(&req);
+ if (ret < 0)
+ return ret;
+
+ *val = req.rbuf[chan->channel];
+
+ return IIO_VAL_INT;
+}
+
+static const struct iio_info twl4030_madc_iio_info = {
+ .read_raw = &twl4030_madc_read,
+ .driver_module = THIS_MODULE,
+};
+
+#define TWL4030_ADC_CHANNEL(_channel, _type, _name) { \
+ .type = _type, \
+ .channel = _channel, \
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
+ BIT(IIO_CHAN_INFO_AVERAGE_RAW) | \
+ BIT(IIO_CHAN_INFO_PROCESSED), \
+ .datasheet_name = _name, \
+ .indexed = 1, \
+}
+
+static const struct iio_chan_spec twl4030_madc_iio_channels[] = {
+ TWL4030_ADC_CHANNEL(0, IIO_VOLTAGE, "ADCIN0"),
+ TWL4030_ADC_CHANNEL(1, IIO_TEMP, "ADCIN1"),
+ TWL4030_ADC_CHANNEL(2, IIO_VOLTAGE, "ADCIN2"),
+ TWL4030_ADC_CHANNEL(3, IIO_VOLTAGE, "ADCIN3"),
+ TWL4030_ADC_CHANNEL(4, IIO_VOLTAGE, "ADCIN4"),
+ TWL4030_ADC_CHANNEL(5, IIO_VOLTAGE, "ADCIN5"),
+ TWL4030_ADC_CHANNEL(6, IIO_VOLTAGE, "ADCIN6"),
+ TWL4030_ADC_CHANNEL(7, IIO_VOLTAGE, "ADCIN7"),
+ TWL4030_ADC_CHANNEL(8, IIO_VOLTAGE, "ADCIN8"),
+ TWL4030_ADC_CHANNEL(9, IIO_VOLTAGE, "ADCIN9"),
+ TWL4030_ADC_CHANNEL(10, IIO_CURRENT, "ADCIN10"),
+ TWL4030_ADC_CHANNEL(11, IIO_VOLTAGE, "ADCIN11"),
+ TWL4030_ADC_CHANNEL(12, IIO_VOLTAGE, "ADCIN12"),
+ TWL4030_ADC_CHANNEL(13, IIO_VOLTAGE, "ADCIN13"),
+ TWL4030_ADC_CHANNEL(14, IIO_VOLTAGE, "ADCIN14"),
+ TWL4030_ADC_CHANNEL(15, IIO_VOLTAGE, "ADCIN15"),
+};
+
static struct twl4030_madc_data *twl4030_madc;
struct twl4030_prescale_divider_ratios {
@@ -702,28 +766,49 @@ static int twl4030_madc_probe(struct platform_device *pdev)
{
struct twl4030_madc_data *madc;
struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev);
+ struct device_node *np = pdev->dev.of_node;
int irq, ret;
u8 regval;
+ struct iio_dev *iio_dev = NULL;
- if (!pdata) {
- dev_err(&pdev->dev, "platform_data not available\n");
+ if (!pdata && !np) {
+ dev_err(&pdev->dev, "neither platform data nor Device Tree node available\n");
return -EINVAL;
}
- madc = devm_kzalloc(&pdev->dev, sizeof(*madc), GFP_KERNEL);
- if (!madc)
+
+ iio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*madc));
+ if (!iio_dev) {
+ dev_err(&pdev->dev, "failed allocating iio device\n");
return -ENOMEM;
+ }
+ madc = iio_priv(iio_dev);
madc->dev = &pdev->dev;
+ iio_dev->name = dev_name(&pdev->dev);
+ iio_dev->dev.parent = &pdev->dev;
+ iio_dev->dev.of_node = pdev->dev.of_node;
+ iio_dev->info = &twl4030_madc_iio_info;
+ iio_dev->modes = INDIO_DIRECT_MODE;
+ iio_dev->channels = twl4030_madc_iio_channels;
+ iio_dev->num_channels = ARRAY_SIZE(twl4030_madc_iio_channels);
+
/*
* Phoenix provides 2 interrupt lines. The first one is connected to
* the OMAP. The other one can be connected to the other processor such
* as modem. Hence two separate ISR and IMR registers.
*/
- madc->imr = (pdata->irq_line == 1) ?
- TWL4030_MADC_IMR1 : TWL4030_MADC_IMR2;
- madc->isr = (pdata->irq_line == 1) ?
- TWL4030_MADC_ISR1 : TWL4030_MADC_ISR2;
+ if (pdata)
+ madc->use_second_irq = (pdata->irq_line != 1);
+ else
+ madc->use_second_irq = of_property_read_bool(np,
+ "ti,system-uses-second-madc-irq");
+
+ madc->imr = madc->use_second_irq ? TWL4030_MADC_IMR2 :
+ TWL4030_MADC_IMR1;
+ madc->isr = madc->use_second_irq ? TWL4030_MADC_ISR2 :
+ TWL4030_MADC_ISR1;
+
ret = twl4030_madc_set_power(madc, 1);
if (ret < 0)
return ret;
@@ -768,7 +853,7 @@ static int twl4030_madc_probe(struct platform_device *pdev)
}
}
- platform_set_drvdata(pdev, madc);
+ platform_set_drvdata(pdev, iio_dev);
mutex_init(&madc->lock);
irq = platform_get_irq(pdev, 0);
@@ -776,11 +861,19 @@ static int twl4030_madc_probe(struct platform_device *pdev)
twl4030_madc_threaded_irq_handler,
IRQF_TRIGGER_RISING, "twl4030_madc", madc);
if (ret) {
- dev_dbg(&pdev->dev, "could not request irq\n");
+ dev_err(&pdev->dev, "could not request irq\n");
goto err_i2c;
}
twl4030_madc = madc;
+
+ ret = iio_device_register(iio_dev);
+ if (ret) {
+ dev_err(&pdev->dev, "could not register iio device\n");
+ goto err_i2c;
+ }
+
return 0;
+
err_i2c:
twl4030_madc_set_current_generator(madc, 0, 0);
err_current_generator:
@@ -790,7 +883,10 @@ err_current_generator:
static int twl4030_madc_remove(struct platform_device *pdev)
{
- struct twl4030_madc_data *madc = platform_get_drvdata(pdev);
+ struct iio_dev *iio_dev = platform_get_drvdata(pdev);
+ struct twl4030_madc_data *madc = iio_priv(iio_dev);
+
+ iio_device_unregister(iio_dev);
twl4030_madc_set_current_generator(madc, 0, 0);
twl4030_madc_set_power(madc, 0);
@@ -798,12 +894,21 @@ static int twl4030_madc_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id twl_madc_of_match[] = {
+ { .compatible = "ti,twl4030-madc", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, twl_madc_of_match);
+#endif
+
static struct platform_driver twl4030_madc_driver = {
.probe = twl4030_madc_probe,
.remove = twl4030_madc_remove,
.driver = {
.name = "twl4030_madc",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(twl_madc_of_match),
},
};
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 3/7] mfd: twl4030-madc: Cleanup driver
2014-03-16 1:43 ` Sebastian Reichel
` (2 preceding siblings ...)
(?)
@ 2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 8:00 ` Lee Jones
-1 siblings, 1 reply; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
Some style fixes in twl4030-madc driver.
Reported-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: Marek Belisko <marek@goldelico.com>
---
drivers/mfd/twl4030-madc.c | 145 +++++++++++++++++++--------------------
include/linux/i2c/twl4030-madc.h | 2 +-
2 files changed, 73 insertions(+), 74 deletions(-)
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index 93ef912..98b9c98 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -49,22 +49,22 @@
#include <linux/iio/iio.h>
-/*
+/**
* struct twl4030_madc_data - a container for madc info
- * @dev - pointer to device structure for madc
- * @lock - mutex protecting this data structure
- * @requests - Array of request struct corresponding to SW1, SW2 and RT
- * @use_second_irq - IRQ selection (main or co-processor)
- * @imr - Interrupt mask register of MADC
- * @isr - Interrupt status register of MADC
+ * @dev: Pointer to device structure for madc
+ * @lock: Mutex protecting this data structure
+ * @requests: Array of request struct corresponding to SW1, SW2 and RT
+ * @use_second_irq: IRQ selection (main or co-processor)
+ * @imr: Interrupt mask register of MADC
+ * @isr: Interrupt status register of MADC
*/
struct twl4030_madc_data {
struct device *dev;
struct mutex lock; /* mutex protecting this data structure */
struct twl4030_madc_request requests[TWL4030_MADC_NUM_METHODS];
bool use_second_irq;
- int imr;
- int isr;
+ u8 imr;
+ u8 isr;
};
static int twl4030_madc_read(struct iio_dev *iio_dev,
@@ -155,17 +155,16 @@ twl4030_divider_ratios[16] = {
};
-/*
- * Conversion table from -3 to 55 degree Celcius
- */
-static int therm_tbl[] = {
-30800, 29500, 28300, 27100,
-26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
-17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
-11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
-8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
-5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
-4040, 3910, 3790, 3670, 3550
+/* Conversion table from -3 to 55 degrees Celcius */
+static int twl4030_therm_tbl[] = {
+ 30800, 29500, 28300, 27100,
+ 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700,
+ 17900, 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100,
+ 12600, 12100, 11600, 11200, 10800, 10400, 10000, 9630, 9280,
+ 8950, 8620, 8310, 8020, 7730, 7460, 7200, 6950, 6710,
+ 6470, 6250, 6040, 5830, 5640, 5450, 5260, 5090, 4920,
+ 4760, 4600, 4450, 4310, 4170, 4040, 3910, 3790, 3670,
+ 3550
};
/*
@@ -197,11 +196,12 @@ const struct twl4030_madc_conversion_method twl4030_conversion_methods[] = {
},
};
-/*
- * Function to read a particular channel value.
- * @madc - pointer to struct twl4030_madc_data
- * @reg - lsb of ADC Channel
- * If the i2c read fails it returns an error else returns 0.
+/**
+ * twl4030_madc_channel_raw_read() - Function to read a particular channel value
+ * @madc: pointer to struct twl4030_madc_data
+ * @reg: lsb of ADC Channel
+ *
+ * Return: 0 on success, an error code otherwise.
*/
static int twl4030_madc_channel_raw_read(struct twl4030_madc_data *madc, u8 reg)
{
@@ -227,7 +227,7 @@ static int twl4030_madc_channel_raw_read(struct twl4030_madc_data *madc, u8 reg)
}
/*
- * Return battery temperature
+ * Return battery temperature in degrees Celsius
* Or < 0 on failure.
*/
static int twl4030battery_temperature(int raw_volt)
@@ -236,18 +236,18 @@ static int twl4030battery_temperature(int raw_volt)
int temp, curr, volt, res, ret;
volt = (raw_volt * TEMP_STEP_SIZE) / TEMP_PSR_R;
- /* Getting and calculating the supply current in micro ampers */
+ /* Getting and calculating the supply current in micro amperes */
ret = twl_i2c_read_u8(TWL_MODULE_MAIN_CHARGE, &val,
REG_BCICTL2);
if (ret < 0)
return ret;
+
curr = ((val & TWL4030_BCI_ITHEN) + 1) * 10;
/* Getting and calculating the thermistor resistance in ohms */
res = volt * 1000 / curr;
/* calculating temperature */
for (temp = 58; temp >= 0; temp--) {
- int actual = therm_tbl[temp];
-
+ int actual = twl4030_therm_tbl[temp];
if ((actual - res) >= 0)
break;
}
@@ -269,11 +269,12 @@ static int twl4030battery_current(int raw_volt)
else /* slope of 0.88 mV/mA */
return (raw_volt * CURR_STEP_SIZE) / CURR_PSR_R2;
}
+
/*
* Function to read channel values
* @madc - pointer to twl4030_madc_data struct
* @reg_base - Base address of the first channel
- * @Channels - 16 bit bitmap. If the bit is set, channel value is read
+ * @Channels - 16 bit bitmap. If the bit is set, channel's value is read
* @buf - The channel values are stored here. if read fails error
* @raw - Return raw values without conversion
* value is stored
@@ -284,17 +285,17 @@ static int twl4030_madc_read_channels(struct twl4030_madc_data *madc,
long channels, int *buf,
bool raw)
{
- int count = 0, count_req = 0, i;
+ int count = 0;
+ int i;
u8 reg;
for_each_set_bit(i, &channels, TWL4030_MADC_MAX_CHANNELS) {
- reg = reg_base + 2 * i;
+ reg = reg_base + (2 * i);
buf[i] = twl4030_madc_channel_raw_read(madc, reg);
if (buf[i] < 0) {
- dev_err(madc->dev,
- "Unable to read register 0x%X\n", reg);
- count_req++;
- continue;
+ dev_err(madc->dev, "Unable to read register 0x%X\n",
+ reg);
+ return buf[i];
}
if (raw) {
count++;
@@ -305,7 +306,7 @@ static int twl4030_madc_read_channels(struct twl4030_madc_data *madc,
buf[i] = twl4030battery_current(buf[i]);
if (buf[i] < 0) {
dev_err(madc->dev, "err reading current\n");
- count_req++;
+ return buf[i];
} else {
count++;
buf[i] = buf[i] - 750;
@@ -315,7 +316,7 @@ static int twl4030_madc_read_channels(struct twl4030_madc_data *madc,
buf[i] = twl4030battery_temperature(buf[i]);
if (buf[i] < 0) {
dev_err(madc->dev, "err reading temperature\n");
- count_req++;
+ return buf[i];
} else {
buf[i] -= 3;
count++;
@@ -336,8 +337,6 @@ static int twl4030_madc_read_channels(struct twl4030_madc_data *madc,
twl4030_divider_ratios[i].numerator);
}
}
- if (count_req)
- dev_err(madc->dev, "%d channel conversion failed\n", count_req);
return count;
}
@@ -361,13 +360,13 @@ static int twl4030_madc_enable_irq(struct twl4030_madc_data *madc, u8 id)
madc->imr);
return ret;
}
+
val &= ~(1 << id);
ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, val, madc->imr);
if (ret) {
dev_err(madc->dev,
"unable to write imr register 0x%X\n", madc->imr);
return ret;
-
}
return 0;
@@ -430,7 +429,7 @@ static irqreturn_t twl4030_madc_threaded_irq_handler(int irq, void *_madc)
continue;
ret = twl4030_madc_disable_irq(madc, i);
if (ret < 0)
- dev_dbg(madc->dev, "Disable interrupt failed%d\n", i);
+ dev_dbg(madc->dev, "Disable interrupt failed %d\n", i);
madc->requests[i].result_pending = 1;
}
for (i = 0; i < TWL4030_MADC_NUM_METHODS; i++) {
@@ -512,21 +511,17 @@ static int twl4030_madc_start_conversion(struct twl4030_madc_data *madc,
{
const struct twl4030_madc_conversion_method *method;
int ret = 0;
+
+ if (conv_method != TWL4030_MADC_SW1 && conv_method != TWL4030_MADC_SW2)
+ return -ENOTSUPP;
+
method = &twl4030_conversion_methods[conv_method];
- switch (conv_method) {
- case TWL4030_MADC_SW1:
- case TWL4030_MADC_SW2:
- ret = twl_i2c_write_u8(TWL4030_MODULE_MADC,
- TWL4030_MADC_SW_START, method->ctrl);
- if (ret) {
- dev_err(madc->dev,
- "unable to write ctrl register 0x%X\n",
- method->ctrl);
- return ret;
- }
- break;
- default:
- break;
+ ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, TWL4030_MADC_SW_START,
+ method->ctrl);
+ if (ret) {
+ dev_err(madc->dev, "unable to write ctrl register 0x%X\n",
+ method->ctrl);
+ return ret;
}
return 0;
@@ -623,8 +618,8 @@ int twl4030_madc_conversion(struct twl4030_madc_request *req)
ch_lsb, method->avg);
if (ret) {
dev_err(twl4030_madc->dev,
- "unable to write sel reg 0x%X\n",
- method->sel + 1);
+ "unable to write avg reg 0x%X\n",
+ method->avg);
goto out;
}
}
@@ -665,10 +660,6 @@ out:
}
EXPORT_SYMBOL_GPL(twl4030_madc_conversion);
-/*
- * Return channel value
- * Or < 0 on failure.
- */
int twl4030_get_madc_conversion(int channel_no)
{
struct twl4030_madc_request req;
@@ -689,20 +680,25 @@ int twl4030_get_madc_conversion(int channel_no)
}
EXPORT_SYMBOL_GPL(twl4030_get_madc_conversion);
-/*
+/**
+ * twl4030_madc_set_current_generator() - setup bias current
+ *
+ * @madc: pointer to twl4030_madc_data struct
+ * @chan: can be one of the two values:
+ * TWL4030_BCI_ITHEN
+ * Enables bias current for main battery type reading
+ * TWL4030_BCI_TYPEN
+ * Enables bias current for main battery temperature sensing
+ * @on: enable or disable chan.
+ *
* Function to enable or disable bias current for
* main battery type reading or temperature sensing
- * @madc - pointer to twl4030_madc_data struct
- * @chan - can be one of the two values
- * TWL4030_BCI_ITHEN - Enables bias current for main battery type reading
- * TWL4030_BCI_TYPEN - Enables bias current for main battery temperature
- * sensing
- * @on - enable or disable chan.
*/
static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc,
int chan, int on)
{
int ret;
+ int regmask;
u8 regval;
ret = twl_i2c_read_u8(TWL_MODULE_MAIN_CHARGE,
@@ -712,10 +708,13 @@ static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc,
TWL4030_BCI_BCICTL1);
return ret;
}
+
+ regmask = chan ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN;
if (on)
- regval |= chan ? TWL4030_BCI_ITHEN : TWL4030_BCI_TYPEN;
+ regval |= regmask;
else
- regval &= chan ? ~TWL4030_BCI_ITHEN : ~TWL4030_BCI_TYPEN;
+ regval &= ~regmask;
+
ret = twl_i2c_write_u8(TWL_MODULE_MAIN_CHARGE,
regval, TWL4030_BCI_BCICTL1);
if (ret) {
@@ -730,7 +729,7 @@ static int twl4030_madc_set_current_generator(struct twl4030_madc_data *madc,
/*
* Function that sets MADC software power on bit to enable MADC
* @madc - pointer to twl4030_madc_data struct
- * @on - Enable or disable MADC software powen on bit.
+ * @on - Enable or disable MADC software power on bit.
* returns error if i2c read/write fails else 0
*/
static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on)
@@ -909,7 +908,7 @@ static struct platform_driver twl4030_madc_driver = {
.name = "twl4030_madc",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(twl_madc_of_match),
- },
+ },
};
module_platform_driver(twl4030_madc_driver);
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h
index 01f5951..1c0134d 100644
--- a/include/linux/i2c/twl4030-madc.h
+++ b/include/linux/i2c/twl4030-madc.h
@@ -44,7 +44,7 @@ struct twl4030_madc_conversion_method {
struct twl4030_madc_request {
unsigned long channels;
- u16 do_avg;
+ bool do_avg;
u16 method;
u16 type;
bool active;
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 4/7] mfd: twl-core: Add twl_i2c_read/write_u16
2014-03-16 1:43 ` Sebastian Reichel
` (3 preceding siblings ...)
(?)
@ 2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 8:01 ` Lee Jones
-1 siblings, 1 reply; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
Add a simple twl_i2c_read/write_u16 wrapper over
the twl_i2c_read/write, which is similar to the
twl_i2c_read/write_u8 wrapper.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: Marek Belisko <marek@goldelico.com>
---
include/linux/i2c/twl.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index ade1c06..d2b1670 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -195,6 +195,18 @@ static inline int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg) {
return twl_i2c_read(mod_no, val, reg, 1);
}
+static inline int twl_i2c_write_u16(u8 mod_no, u16 val, u8 reg) {
+ val = cpu_to_le16(val);
+ return twl_i2c_write(mod_no, (u8*) &val, reg, 2);
+}
+
+static inline int twl_i2c_read_u16(u8 mod_no, u16 *val, u8 reg) {
+ int ret;
+ ret = twl_i2c_read(mod_no, (u8*) val, reg, 2);
+ *val = le16_to_cpu(*val);
+ return ret;
+}
+
int twl_get_type(void);
int twl_get_version(void);
int twl_get_hfclk_rate(void);
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 5/7] mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
2014-03-16 1:43 ` Sebastian Reichel
` (4 preceding siblings ...)
(?)
@ 2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 8:01 ` Lee Jones
-1 siblings, 1 reply; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
Simplify reading and writing of 16 bit TWL registers in the
driver by using twl_i2c_read_u16 and twl_i2c_write_u16.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Tested-by: Marek Belisko <marek@goldelico.com>
---
drivers/mfd/twl4030-madc.c | 39 ++++++++-------------------------------
1 file changed, 8 insertions(+), 31 deletions(-)
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index 98b9c98..8a014fb 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -205,25 +205,19 @@ const struct twl4030_madc_conversion_method twl4030_conversion_methods[] = {
*/
static int twl4030_madc_channel_raw_read(struct twl4030_madc_data *madc, u8 reg)
{
- u8 msb, lsb;
+ u16 val;
int ret;
/*
* For each ADC channel, we have MSB and LSB register pair. MSB address
* is always LSB address+1. reg parameter is the address of LSB register
*/
- ret = twl_i2c_read_u8(TWL4030_MODULE_MADC, &msb, reg + 1);
+ ret = twl_i2c_read_u16(TWL4030_MODULE_MADC, &val, reg);
if (ret) {
- dev_err(madc->dev, "unable to read MSB register 0x%X\n",
- reg + 1);
- return ret;
- }
- ret = twl_i2c_read_u8(TWL4030_MODULE_MADC, &lsb, reg);
- if (ret) {
- dev_err(madc->dev, "unable to read LSB register 0x%X\n", reg);
+ dev_err(madc->dev, "unable to read register 0x%X\n", reg);
return ret;
}
- return (int)(((msb << 8) | lsb) >> 6);
+ return (int)(val >> 6);
}
/*
@@ -572,7 +566,6 @@ static int twl4030_madc_wait_conversion_ready(struct twl4030_madc_data *madc,
int twl4030_madc_conversion(struct twl4030_madc_request *req)
{
const struct twl4030_madc_conversion_method *method;
- u8 ch_msb, ch_lsb;
int ret;
if (!req || !twl4030_madc)
@@ -588,37 +581,21 @@ int twl4030_madc_conversion(struct twl4030_madc_request *req)
ret = -EBUSY;
goto out;
}
- ch_msb = (req->channels >> 8) & 0xff;
- ch_lsb = req->channels & 0xff;
method = &twl4030_conversion_methods[req->method];
/* Select channels to be converted */
- ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, ch_msb, method->sel + 1);
+ ret = twl_i2c_write_u16(TWL4030_MODULE_MADC, req->channels, method->sel);
if (ret) {
dev_err(twl4030_madc->dev,
- "unable to write sel register 0x%X\n", method->sel + 1);
- goto out;
- }
- ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, ch_lsb, method->sel);
- if (ret) {
- dev_err(twl4030_madc->dev,
- "unable to write sel register 0x%X\n", method->sel + 1);
+ "unable to write sel register 0x%X\n", method->sel);
goto out;
}
/* Select averaging for all channels if do_avg is set */
if (req->do_avg) {
- ret = twl_i2c_write_u8(TWL4030_MODULE_MADC,
- ch_msb, method->avg + 1);
+ ret = twl_i2c_write_u16(TWL4030_MODULE_MADC, req->channels,
+ method->avg);
if (ret) {
dev_err(twl4030_madc->dev,
"unable to write avg register 0x%X\n",
- method->avg + 1);
- goto out;
- }
- ret = twl_i2c_write_u8(TWL4030_MODULE_MADC,
- ch_lsb, method->avg);
- if (ret) {
- dev_err(twl4030_madc->dev,
- "unable to write avg reg 0x%X\n",
method->avg);
goto out;
}
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 6/7] Documentation: DT: Document twl4030-madc binding
@ 2014-03-16 1:43 ` Sebastian Reichel
0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
Add devicetree binding documentation for twl4030-madc
analog digital converter.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
---
.../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
diff --git a/Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt b/Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
new file mode 100644
index 0000000..6bdd214
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
@@ -0,0 +1,24 @@
+* TWL4030 Monitoring Analog to Digital Converter (MADC)
+
+The MADC subsystem in the TWL4030 consists of a 10-bit ADC
+combined with a 16-input analog multiplexer.
+
+Required properties:
+ - compatible: Should contain "ti,twl4030-madc".
+ - interrupts: IRQ line for the MADC submodule.
+ - #io-channel-cells: Should be set to <1>.
+
+Optional properties:
+ - ti,system-uses-second-madc-irq: boolean, set if the second madc irq register
+ should be used, which is intended to be used
+ by Co-Processors (e.g. a modem).
+
+Example:
+
+&twl {
+ madc {
+ compatible = "ti,twl4030-madc";
+ interrupts = <3>;
+ #io-channel-cells = <1>;
+ };
+};
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 6/7] Documentation: DT: Document twl4030-madc binding
@ 2014-03-16 1:43 ` Sebastian Reichel
0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA, Sebastian Reichel
Add devicetree binding documentation for twl4030-madc
analog digital converter.
Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
.../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
diff --git a/Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt b/Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
new file mode 100644
index 0000000..6bdd214
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
@@ -0,0 +1,24 @@
+* TWL4030 Monitoring Analog to Digital Converter (MADC)
+
+The MADC subsystem in the TWL4030 consists of a 10-bit ADC
+combined with a 16-input analog multiplexer.
+
+Required properties:
+ - compatible: Should contain "ti,twl4030-madc".
+ - interrupts: IRQ line for the MADC submodule.
+ - #io-channel-cells: Should be set to <1>.
+
+Optional properties:
+ - ti,system-uses-second-madc-irq: boolean, set if the second madc irq register
+ should be used, which is intended to be used
+ by Co-Processors (e.g. a modem).
+
+Example:
+
+&twl {
+ madc {
+ compatible = "ti,twl4030-madc";
+ interrupts = <3>;
+ #io-channel-cells = <1>;
+ };
+};
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 7/7] mfd: twl4030-madc: Move driver to drivers/iio/adc
@ 2014-03-16 1:43 ` Sebastian Reichel
0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio, Sebastian Reichel
This is a driver for an A/D converter, which belongs into
drivers/iio/adc.
Signed-off-by: Sebastian Reichel <sre@debian.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/iio/adc/Kconfig | 10 ++++++++++
drivers/iio/adc/Makefile | 1 +
drivers/{mfd => iio/adc}/twl4030-madc.c | 0
drivers/mfd/Kconfig | 10 ----------
drivers/mfd/Makefile | 1 -
5 files changed, 11 insertions(+), 11 deletions(-)
rename drivers/{mfd => iio/adc}/twl4030-madc.c (100%)
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 2209f28..427f75c 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -183,6 +183,16 @@ config TI_AM335X_ADC
Say yes here to build support for Texas Instruments ADC
driver which is also a MFD client.
+config TWL4030_MADC
+ tristate "TWL4030 MADC (Monitoring A/D Converter)"
+ depends on TWL4030_CORE
+ help
+ This driver provides support for Triton TWL4030-MADC. The
+ driver supports both RT and SW conversion methods.
+
+ This driver can also be built as a module. If so, the module will be
+ called twl4030-madc.
+
config TWL6030_GPADC
tristate "TWL6030 GPADC (General Purpose A/D Converter) Support"
depends on TWL4030_CORE
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index ba9a10a..9acf2df 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -20,5 +20,6 @@ obj-$(CONFIG_MCP3422) += mcp3422.o
obj-$(CONFIG_NAU7802) += nau7802.o
obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o
obj-$(CONFIG_TI_AM335X_ADC) += ti_am335x_adc.o
+obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
obj-$(CONFIG_TWL6030_GPADC) += twl6030-gpadc.o
obj-$(CONFIG_VIPERBOARD_ADC) += viperboard_adc.o
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
similarity index 100%
rename from drivers/mfd/twl4030-madc.c
rename to drivers/iio/adc/twl4030-madc.c
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 49bb445..23a8a51 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -935,16 +935,6 @@ config TWL4030_CORE
high speed USB OTG transceiver, an audio codec (on most
versions) and many other features.
-config TWL4030_MADC
- tristate "TI TWL4030 MADC"
- depends on TWL4030_CORE
- help
- This driver provides support for triton TWL4030-MADC. The
- driver supports both RT and SW conversion methods.
-
- This driver can be built as a module. If so it will be
- named twl4030-madc
-
config TWL4030_POWER
bool "TI TWL4030 power resources"
depends on TWL4030_CORE && ARM
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 5aea5ef..c8eb0bc 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -71,7 +71,6 @@ obj-$(CONFIG_MFD_TPS80031) += tps80031.o
obj-$(CONFIG_MENELAUS) += menelaus.o
obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
-obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o
obj-$(CONFIG_TWL6040_CORE) += twl6040.o
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCHv4 7/7] mfd: twl4030-madc: Move driver to drivers/iio/adc
@ 2014-03-16 1:43 ` Sebastian Reichel
0 siblings, 0 replies; 27+ messages in thread
From: Sebastian Reichel @ 2014-03-16 1:43 UTC (permalink / raw)
To: Sebastian Reichel, Marek Belisko, Jonathan Cameron
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA, Sebastian Reichel
This is a driver for an A/D converter, which belongs into
drivers/iio/adc.
Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/iio/adc/Kconfig | 10 ++++++++++
drivers/iio/adc/Makefile | 1 +
drivers/{mfd => iio/adc}/twl4030-madc.c | 0
drivers/mfd/Kconfig | 10 ----------
drivers/mfd/Makefile | 1 -
5 files changed, 11 insertions(+), 11 deletions(-)
rename drivers/{mfd => iio/adc}/twl4030-madc.c (100%)
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 2209f28..427f75c 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -183,6 +183,16 @@ config TI_AM335X_ADC
Say yes here to build support for Texas Instruments ADC
driver which is also a MFD client.
+config TWL4030_MADC
+ tristate "TWL4030 MADC (Monitoring A/D Converter)"
+ depends on TWL4030_CORE
+ help
+ This driver provides support for Triton TWL4030-MADC. The
+ driver supports both RT and SW conversion methods.
+
+ This driver can also be built as a module. If so, the module will be
+ called twl4030-madc.
+
config TWL6030_GPADC
tristate "TWL6030 GPADC (General Purpose A/D Converter) Support"
depends on TWL4030_CORE
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index ba9a10a..9acf2df 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -20,5 +20,6 @@ obj-$(CONFIG_MCP3422) += mcp3422.o
obj-$(CONFIG_NAU7802) += nau7802.o
obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o
obj-$(CONFIG_TI_AM335X_ADC) += ti_am335x_adc.o
+obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
obj-$(CONFIG_TWL6030_GPADC) += twl6030-gpadc.o
obj-$(CONFIG_VIPERBOARD_ADC) += viperboard_adc.o
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
similarity index 100%
rename from drivers/mfd/twl4030-madc.c
rename to drivers/iio/adc/twl4030-madc.c
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 49bb445..23a8a51 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -935,16 +935,6 @@ config TWL4030_CORE
high speed USB OTG transceiver, an audio codec (on most
versions) and many other features.
-config TWL4030_MADC
- tristate "TI TWL4030 MADC"
- depends on TWL4030_CORE
- help
- This driver provides support for triton TWL4030-MADC. The
- driver supports both RT and SW conversion methods.
-
- This driver can be built as a module. If so it will be
- named twl4030-madc
-
config TWL4030_POWER
bool "TI TWL4030 power resources"
depends on TWL4030_CORE && ARM
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 5aea5ef..c8eb0bc 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -71,7 +71,6 @@ obj-$(CONFIG_MFD_TPS80031) += tps80031.o
obj-$(CONFIG_MENELAUS) += menelaus.o
obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
-obj-$(CONFIG_TWL4030_MADC) += twl4030-madc.o
obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o
obj-$(CONFIG_TWL6040_CORE) += twl6040.o
--
1.9.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCHv4 0/7] Convert twl4030-madc to IIO API and add DT support
@ 2014-03-16 17:46 ` Jonathan Cameron
0 siblings, 0 replies; 27+ messages in thread
From: Jonathan Cameron @ 2014-03-16 17:46 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Marek Belisko
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel, devicetree, linux-iio
Hi Lee,
I'm happy with whole lot and looks like you are as well.
The only outstanding delaying element I can see is the lack
of a device tree ack. That patch has been the same for over
a month though....
Lots more possible cleanup in this driver though for Sebastian
or anyone else to take on when they are bored!
Jonathan
On 16/03/14 01:43, Sebastian Reichel wrote:
> Hi,
>
> This is PATCHv4 for converting twl4030-madc to the IIO API and
> adding DT support. The plan is to remove the private twl4030-madc
> API once all users have been removed or converted to the IIO API.
> The patchset compiles and has been tested on my Nokia N900.
>
> Changes since PATCHv3 [0]:
> * Dropped the following patches (applied in iio tree)
> - iio: documentation: Add ABI documentation for *_mean_raw
> - iio: inkern: add iio_read_channel_average_raw
> * Added some more Acked-by from Jonathan Cameron
> - one of them on the basis of "Reorder that and I'm happy".
> * Changed some minor stuff requested by Jonathan
> - reorder cleanup calls in driver's remove function
> - convert another comment to kerneldoc
>
> Status:
> * Only feedback from DT binding maintainers is missing.
> side note: The binding & the corresponding binding documentation
> patch has not changed since 2014-02-13. So depending on when the
> time frame starts the three weeks are over already ;)
> * It would be nice to see this patchset in 3.15.
>
> [0] https://lkml.org/lkml/2014/3/10/727
>
> -- Sebastian
>
> Sebastian Reichel (7):
> mfd: twl4030-madc: Use managed resources
> mfd: twl4030-madc: Add DT support and convert to IIO framework
> mfd: twl4030-madc: Cleanup driver
> mfd: twl-core: Add twl_i2c_read/write_u16
> mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
> Documentation: DT: Document twl4030-madc binding
> mfd: twl4030-madc: Move driver to drivers/iio/adc
>
> .../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++
> drivers/iio/adc/Kconfig | 10 +
> drivers/iio/adc/Makefile | 1 +
> drivers/{mfd => iio/adc}/twl4030-madc.c | 320 +++++++++++++--------
> drivers/mfd/Kconfig | 10 -
> drivers/mfd/Makefile | 1 -
> include/linux/i2c/twl.h | 12 +
> include/linux/i2c/twl4030-madc.h | 2 +-
> 8 files changed, 247 insertions(+), 133 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
> rename drivers/{mfd => iio/adc}/twl4030-madc.c (74%)
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 0/7] Convert twl4030-madc to IIO API and add DT support
@ 2014-03-16 17:46 ` Jonathan Cameron
0 siblings, 0 replies; 27+ messages in thread
From: Jonathan Cameron @ 2014-03-16 17:46 UTC (permalink / raw)
To: Sebastian Reichel, Sebastian Reichel, Marek Belisko
Cc: Lee Jones, Samuel Ortiz, Lars-Peter Clausen, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
Hi Lee,
I'm happy with whole lot and looks like you are as well.
The only outstanding delaying element I can see is the lack
of a device tree ack. That patch has been the same for over
a month though....
Lots more possible cleanup in this driver though for Sebastian
or anyone else to take on when they are bored!
Jonathan
On 16/03/14 01:43, Sebastian Reichel wrote:
> Hi,
>
> This is PATCHv4 for converting twl4030-madc to the IIO API and
> adding DT support. The plan is to remove the private twl4030-madc
> API once all users have been removed or converted to the IIO API.
> The patchset compiles and has been tested on my Nokia N900.
>
> Changes since PATCHv3 [0]:
> * Dropped the following patches (applied in iio tree)
> - iio: documentation: Add ABI documentation for *_mean_raw
> - iio: inkern: add iio_read_channel_average_raw
> * Added some more Acked-by from Jonathan Cameron
> - one of them on the basis of "Reorder that and I'm happy".
> * Changed some minor stuff requested by Jonathan
> - reorder cleanup calls in driver's remove function
> - convert another comment to kerneldoc
>
> Status:
> * Only feedback from DT binding maintainers is missing.
> side note: The binding & the corresponding binding documentation
> patch has not changed since 2014-02-13. So depending on when the
> time frame starts the three weeks are over already ;)
> * It would be nice to see this patchset in 3.15.
>
> [0] https://lkml.org/lkml/2014/3/10/727
>
> -- Sebastian
>
> Sebastian Reichel (7):
> mfd: twl4030-madc: Use managed resources
> mfd: twl4030-madc: Add DT support and convert to IIO framework
> mfd: twl4030-madc: Cleanup driver
> mfd: twl-core: Add twl_i2c_read/write_u16
> mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
> Documentation: DT: Document twl4030-madc binding
> mfd: twl4030-madc: Move driver to drivers/iio/adc
>
> .../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++
> drivers/iio/adc/Kconfig | 10 +
> drivers/iio/adc/Makefile | 1 +
> drivers/{mfd => iio/adc}/twl4030-madc.c | 320 +++++++++++++--------
> drivers/mfd/Kconfig | 10 -
> drivers/mfd/Makefile | 1 -
> include/linux/i2c/twl.h | 12 +
> include/linux/i2c/twl4030-madc.h | 2 +-
> 8 files changed, 247 insertions(+), 133 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
> rename drivers/{mfd => iio/adc}/twl4030-madc.c (74%)
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 1/7] mfd: twl4030-madc: Use managed resources
@ 2014-03-18 7:59 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 7:59 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> Update twl4030-madc driver to use managed resources.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Tested-by: Marek Belisko <marek@goldelico.com>
> ---
> drivers/mfd/twl4030-madc.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 1/7] mfd: twl4030-madc: Use managed resources
@ 2014-03-18 7:59 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 7:59 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
> Update twl4030-madc driver to use managed resources.
>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Tested-by: Marek Belisko <marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
> ---
> drivers/mfd/twl4030-madc.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 2/7] mfd: twl4030-madc: Add DT support and convert to IIO framework
@ 2014-03-18 8:00 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:00 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> This converts twl4030-madc module to use the Industrial IO ADC
> framework and adds device tree support.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Tested-by: Marek Belisko <marek@goldelico.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> drivers/mfd/twl4030-madc.c | 127 +++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 116 insertions(+), 11 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 2/7] mfd: twl4030-madc: Add DT support and convert to IIO framework
@ 2014-03-18 8:00 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:00 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
> This converts twl4030-madc module to use the Industrial IO ADC
> framework and adds device tree support.
>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> Tested-by: Marek Belisko <marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> drivers/mfd/twl4030-madc.c | 127 +++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 116 insertions(+), 11 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 3/7] mfd: twl4030-madc: Cleanup driver
@ 2014-03-18 8:00 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:00 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> Some style fixes in twl4030-madc driver.
>
> Reported-by: Jonathan Cameron <jic23@kernel.org>
> Reported-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Tested-by: Marek Belisko <marek@goldelico.com>
> ---
> drivers/mfd/twl4030-madc.c | 145 +++++++++++++++++++--------------------
> include/linux/i2c/twl4030-madc.h | 2 +-
> 2 files changed, 73 insertions(+), 74 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 3/7] mfd: twl4030-madc: Cleanup driver
@ 2014-03-18 8:00 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:00 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
> Some style fixes in twl4030-madc driver.
>
> Reported-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Reported-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Tested-by: Marek Belisko <marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
> ---
> drivers/mfd/twl4030-madc.c | 145 +++++++++++++++++++--------------------
> include/linux/i2c/twl4030-madc.h | 2 +-
> 2 files changed, 73 insertions(+), 74 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 4/7] mfd: twl-core: Add twl_i2c_read/write_u16
2014-03-16 1:43 ` [PATCHv4 4/7] mfd: twl-core: Add twl_i2c_read/write_u16 Sebastian Reichel
@ 2014-03-18 8:01 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:01 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> Add a simple twl_i2c_read/write_u16 wrapper over
> the twl_i2c_read/write, which is similar to the
> twl_i2c_read/write_u8 wrapper.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Tested-by: Marek Belisko <marek@goldelico.com>
> ---
> include/linux/i2c/twl.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 5/7] mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
@ 2014-03-18 8:01 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:01 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> Simplify reading and writing of 16 bit TWL registers in the
> driver by using twl_i2c_read_u16 and twl_i2c_write_u16.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Tested-by: Marek Belisko <marek@goldelico.com>
> ---
> drivers/mfd/twl4030-madc.c | 39 ++++++++-------------------------------
> 1 file changed, 8 insertions(+), 31 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 5/7] mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
@ 2014-03-18 8:01 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:01 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
> Simplify reading and writing of 16 bit TWL registers in the
> driver by using twl_i2c_read_u16 and twl_i2c_write_u16.
>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Tested-by: Marek Belisko <marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
> ---
> drivers/mfd/twl4030-madc.c | 39 ++++++++-------------------------------
> 1 file changed, 8 insertions(+), 31 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 6/7] Documentation: DT: Document twl4030-madc binding
@ 2014-03-18 8:02 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:02 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> Add devicetree binding documentation for twl4030-madc
> analog digital converter.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> .../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 6/7] Documentation: DT: Document twl4030-madc binding
@ 2014-03-18 8:02 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:02 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
> Add devicetree binding documentation for twl4030-madc
> analog digital converter.
>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> .../devicetree/bindings/iio/adc/twl4030-madc.txt | 24 ++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 7/7] mfd: twl4030-madc: Move driver to drivers/iio/adc
@ 2014-03-18 8:02 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:02 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
linux-iio
> This is a driver for an A/D converter, which belongs into
> drivers/iio/adc.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> drivers/iio/adc/Kconfig | 10 ++++++++++
> drivers/iio/adc/Makefile | 1 +
> drivers/{mfd => iio/adc}/twl4030-madc.c | 0
> drivers/mfd/Kconfig | 10 ----------
> drivers/mfd/Makefile | 1 -
> 5 files changed, 11 insertions(+), 11 deletions(-)
> rename drivers/{mfd => iio/adc}/twl4030-madc.c (100%)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCHv4 7/7] mfd: twl4030-madc: Move driver to drivers/iio/adc
@ 2014-03-18 8:02 ` Lee Jones
0 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:02 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Marek Belisko, Jonathan Cameron, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-iio-u79uwXL29TY76Z2rM5mHXA
> This is a driver for an A/D converter, which belongs into
> drivers/iio/adc.
>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> drivers/iio/adc/Kconfig | 10 ++++++++++
> drivers/iio/adc/Makefile | 1 +
> drivers/{mfd => iio/adc}/twl4030-madc.c | 0
> drivers/mfd/Kconfig | 10 ----------
> drivers/mfd/Makefile | 1 -
> 5 files changed, 11 insertions(+), 11 deletions(-)
> rename drivers/{mfd => iio/adc}/twl4030-madc.c (100%)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
* [GIT PULL] mfd: Immutable branch for Sebastian Reichel's work on mfd->io driver conversion
2014-03-16 1:43 ` Sebastian Reichel
` (8 preceding siblings ...)
(?)
@ 2014-03-18 8:21 ` Lee Jones
-1 siblings, 0 replies; 27+ messages in thread
From: Lee Jones @ 2014-03-18 8:21 UTC (permalink / raw)
To: linux-iio, Jonathan Cameron
Cc: Sebastian Reichel, Marek Belisko, Samuel Ortiz,
Lars-Peter Clausen, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Grant Likely, linux-kernel, devicetree,
sre
The following changes since commit 0414855fdc4a40da05221fc6062cccbc0c30f169:
Linux 3.14-rc5 (2014-03-02 18:56:16 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-io-3.15
for you to fetch changes up to b2931b98cebfb30d940f248d2054b5268eae87a4:
mfd: twl4030-madc: Move driver to drivers/iio/adc (2014-03-18 08:16:20 +0000)
----------------------------------------------------------------
Sebastian Reichel (7):
mfd: twl4030-madc: Use managed resources
mfd: twl4030-madc: Add DT support and convert to IIO framework
mfd: twl4030-madc: Cleanup driver
mfd: twl-core: Add twl_i2c_read/write_u16
mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers
Documentation: DT: Document twl4030-madc binding
mfd: twl4030-madc: Move driver to drivers/iio/adc
Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt | 24 +++++++++
drivers/iio/adc/Kconfig | 10 ++++
drivers/iio/adc/Makefile | 1 +
drivers/{mfd => iio/adc}/twl4030-madc.c | 320 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------
drivers/mfd/Kconfig | 10 ----
drivers/mfd/Makefile | 1 -
include/linux/i2c/twl.h | 12 +++++
include/linux/i2c/twl4030-madc.h | 2 +-
8 files changed, 247 insertions(+), 133 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/twl4030-madc.txt
rename drivers/{mfd => iio/adc}/twl4030-madc.c (74%)
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2014-03-18 8:21 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-16 1:43 [PATCHv4 0/7] Convert twl4030-madc to IIO API and add DT support Sebastian Reichel
2014-03-16 1:43 ` Sebastian Reichel
2014-03-16 1:43 ` [PATCHv4 1/7] mfd: twl4030-madc: Use managed resources Sebastian Reichel
2014-03-18 7:59 ` Lee Jones
2014-03-18 7:59 ` Lee Jones
2014-03-16 1:43 ` [PATCHv4 2/7] mfd: twl4030-madc: Add DT support and convert to IIO framework Sebastian Reichel
2014-03-18 8:00 ` Lee Jones
2014-03-18 8:00 ` Lee Jones
2014-03-16 1:43 ` [PATCHv4 3/7] mfd: twl4030-madc: Cleanup driver Sebastian Reichel
2014-03-18 8:00 ` Lee Jones
2014-03-18 8:00 ` Lee Jones
2014-03-16 1:43 ` [PATCHv4 4/7] mfd: twl-core: Add twl_i2c_read/write_u16 Sebastian Reichel
2014-03-18 8:01 ` Lee Jones
2014-03-16 1:43 ` [PATCHv4 5/7] mfd: twl4030-madc: Use twl_i2c_read/write_u16 for 16 bit registers Sebastian Reichel
2014-03-18 8:01 ` Lee Jones
2014-03-18 8:01 ` Lee Jones
2014-03-16 1:43 ` [PATCHv4 6/7] Documentation: DT: Document twl4030-madc binding Sebastian Reichel
2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 8:02 ` Lee Jones
2014-03-18 8:02 ` Lee Jones
2014-03-16 1:43 ` [PATCHv4 7/7] mfd: twl4030-madc: Move driver to drivers/iio/adc Sebastian Reichel
2014-03-16 1:43 ` Sebastian Reichel
2014-03-18 8:02 ` Lee Jones
2014-03-18 8:02 ` Lee Jones
2014-03-16 17:46 ` [PATCHv4 0/7] Convert twl4030-madc to IIO API and add DT support Jonathan Cameron
2014-03-16 17:46 ` Jonathan Cameron
2014-03-18 8:21 ` [GIT PULL] mfd: Immutable branch for Sebastian Reichel's work on mfd->io driver conversion Lee Jones
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.