All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver
@ 2013-06-23 21:30 Peter Meerwald
  2013-06-23 21:30 ` [PATCH 2/4] iio: add powerdown to mcp4725 dac drive Peter Meerwald
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Peter Meerwald @ 2013-06-23 21:30 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/dac/mcp4725.c | 64 +++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 62 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index a612ec7..cb9db90 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -12,14 +12,13 @@
  * driver for the Microchip I2C 12-bit digital-to-analog converter (DAC)
  * (7-bit I2C slave address 0x60, the three LSBs can be configured in
  * hardware)
- *
- * writing the DAC value to EEPROM is not supported
  */
 
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/err.h>
+#include <linux/delay.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -64,6 +63,66 @@ static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume);
 #define MCP4725_PM_OPS NULL
 #endif
 
+static int mcp4725_store_eeprom(struct device *dev,
+	struct device_attribute *attr, const char *buf, size_t len)
+{
+	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+	struct mcp4725_data *data = iio_priv(indio_dev);
+	int tries = 20;
+	u8 inoutbuf[3];
+	bool state;
+	int ret;
+
+	ret = strtobool(buf, &state);
+	if (ret < 0)
+		return ret;
+
+	if (!state)
+		return 0;
+
+	inoutbuf[0] = 0x60; /* write EEPROM */
+	inoutbuf[1] = data->dac_value >> 4;
+	inoutbuf[2] = (data->dac_value & 0xf) << 4;
+
+	ret = i2c_master_send(data->client, inoutbuf, 3);
+	if (ret < 0)
+		return ret;
+	else if (ret != 3)
+		return -EIO;
+
+	/* wait for write complete, takes up to 50ms */
+	while (tries--) {
+		msleep(20);
+		ret = i2c_master_recv(data->client, inoutbuf, 3);
+		if (ret < 0)
+			return ret;
+		else if (ret != 3)
+			return -EIO;
+
+		if (inoutbuf[0] & 0x80)
+			break;
+	}
+
+	if (tries < 0) {
+		dev_err(&data->client->dev,
+			"mcp4725_store_eeprom() failed, incomplete\n");
+		return -EIO;
+	}
+
+	return len;
+}
+
+static IIO_DEVICE_ATTR(store_eeprom, S_IWUSR, NULL, mcp4725_store_eeprom, 0);
+
+static struct attribute *mcp4725_attributes[] = {
+	&iio_dev_attr_store_eeprom.dev_attr.attr,
+	NULL,
+};
+
+static const struct attribute_group mcp4725_attribute_group = {
+	.attrs = mcp4725_attributes,
+};
+
 static const struct iio_chan_spec mcp4725_channel = {
 	.type		= IIO_VOLTAGE,
 	.indexed	= 1,
@@ -138,6 +197,7 @@ static int mcp4725_write_raw(struct iio_dev *indio_dev,
 static const struct iio_info mcp4725_info = {
 	.read_raw = mcp4725_read_raw,
 	.write_raw = mcp4725_write_raw,
+	.attrs = &mcp4725_attribute_group,
 	.driver_module = THIS_MODULE,
 };
 
-- 
1.8.3.1


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

* [PATCH 2/4] iio: add powerdown to mcp4725 dac drive
  2013-06-23 21:30 [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Peter Meerwald
@ 2013-06-23 21:30 ` Peter Meerwald
  2013-06-29 12:23   ` Jonathan Cameron
  2013-06-23 21:30 ` [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes Peter Meerwald
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Peter Meerwald @ 2013-06-23 21:30 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/dac/mcp4725.c | 87 +++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 85 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index cb9db90..f569738 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -31,15 +31,19 @@ struct mcp4725_data {
 	struct i2c_client *client;
 	u16 vref_mv;
 	u16 dac_value;
+	bool powerdown;
+	unsigned powerdown_mode;
 };
 
-#ifdef CONFIG_PM_SLEEP
 static int mcp4725_suspend(struct device *dev)
 {
+	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
+	struct mcp4725_data *data = iio_priv(indio_dev);
 	u8 outbuf[2];
 
-	outbuf[0] = 0x3 << 4; /* power-down bits, 500 kOhm resistor */
+	outbuf[0] = (data->powerdown_mode + 1) << 4;
 	outbuf[1] = 0;
+	data->powerdown = true;
 
 	return i2c_master_send(to_i2c_client(dev), outbuf, 2);
 }
@@ -53,10 +57,12 @@ static int mcp4725_resume(struct device *dev)
 	/* restore previous DAC value */
 	outbuf[0] = (data->dac_value >> 8) & 0xf;
 	outbuf[1] = data->dac_value & 0xff;
+	data->powerdown = false;
 
 	return i2c_master_send(to_i2c_client(dev), outbuf, 2);
 }
 
+#ifdef CONFIG_PM_SLEEP
 static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume);
 #define MCP4725_PM_OPS (&mcp4725_pm_ops)
 #else
@@ -123,6 +129,78 @@ static const struct attribute_group mcp4725_attribute_group = {
 	.attrs = mcp4725_attributes,
 };
 
+static const char * const mcp4725_powerdown_modes[] = {
+	"1kohm_to_gnd",
+	"100kohm_to_gnd",
+	"500kohm_to_gnd"
+};
+
+static int mcp4725_get_powerdown_mode(struct iio_dev *indio_dev,
+	const struct iio_chan_spec *chan)
+{
+	struct mcp4725_data *data = iio_priv(indio_dev);
+
+	return data->powerdown_mode;
+}
+
+static int mcp4725_set_powerdown_mode(struct iio_dev *indio_dev,
+	const struct iio_chan_spec *chan, unsigned mode)
+{
+	struct mcp4725_data *data = iio_priv(indio_dev);
+
+	data->powerdown_mode = mode;
+
+	return 0;
+}
+
+static ssize_t mcp4725_read_powerdown(struct iio_dev *indio_dev,
+	uintptr_t private, const struct iio_chan_spec *chan, char *buf)
+{
+	struct mcp4725_data *data = iio_priv(indio_dev);
+
+	return sprintf(buf, "%d\n", data->powerdown);
+}
+
+static ssize_t mcp4725_write_powerdown(struct iio_dev *indio_dev,
+	 uintptr_t private, const struct iio_chan_spec *chan,
+	 const char *buf, size_t len)
+{
+	struct mcp4725_data *data = iio_priv(indio_dev);
+	bool state;
+	int ret;
+
+	ret = strtobool(buf, &state);
+	if (ret)
+		return ret;
+
+	if (state)
+		ret = mcp4725_suspend(&data->client->dev);
+	else
+		ret = mcp4725_resume(&data->client->dev);
+	if (ret < 0)
+		return ret;
+
+	return len;
+}
+
+static const struct iio_enum mcp4725_powerdown_mode_enum = {
+	.items = mcp4725_powerdown_modes,
+	.num_items = ARRAY_SIZE(mcp4725_powerdown_modes),
+	.get = mcp4725_get_powerdown_mode,
+	.set = mcp4725_set_powerdown_mode,
+};
+
+static const struct iio_chan_spec_ext_info mcp4725_ext_info[] = {
+	{
+		.name = "powerdown",
+		.read = mcp4725_read_powerdown,
+		.write = mcp4725_write_powerdown,
+	},
+	IIO_ENUM("powerdown_mode", false, &mcp4725_powerdown_mode_enum),
+	IIO_ENUM_AVAILABLE("powerdown_mode", &mcp4725_powerdown_mode_enum),
+	{ },
+};
+
 static const struct iio_chan_spec mcp4725_channel = {
 	.type		= IIO_VOLTAGE,
 	.indexed	= 1,
@@ -131,6 +209,7 @@ static const struct iio_chan_spec mcp4725_channel = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 	.scan_type	= IIO_ST('u', 12, 16, 0),
+	.ext_info	= mcp4725_ext_info,
 };
 
 static int mcp4725_set_value(struct iio_dev *indio_dev, int val)
@@ -208,6 +287,7 @@ static int mcp4725_probe(struct i2c_client *client,
 	struct iio_dev *indio_dev;
 	struct mcp4725_platform_data *platform_data = client->dev.platform_data;
 	u8 inbuf[3];
+	u8 pd;
 	int err;
 
 	if (!platform_data || !platform_data->vref_mv) {
@@ -239,6 +319,9 @@ static int mcp4725_probe(struct i2c_client *client,
 		dev_err(&client->dev, "failed to read DAC value");
 		goto exit_free_device;
 	}
+	pd = (inbuf[0] >> 1) & 0x3;
+	data->powerdown = pd > 0 ? true : false;
+	data->powerdown_mode = pd ? pd-1 : 2; /* 500kohm_to_gnd */
 	data->dac_value = (inbuf[1] << 4) | (inbuf[2] >> 4);
 
 	err = iio_device_register(indio_dev);
-- 
1.8.3.1


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

* [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes
  2013-06-23 21:30 [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Peter Meerwald
  2013-06-23 21:30 ` [PATCH 2/4] iio: add powerdown to mcp4725 dac drive Peter Meerwald
@ 2013-06-23 21:30 ` Peter Meerwald
  2013-06-29 12:23   ` Jonathan Cameron
  2013-06-23 21:30 ` [PATCH 4/4] iio: move ABI specification for store_eeprom; is used by ad9523, mcp4725 and ds1077 devices Peter Meerwald
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Peter Meerwald @ 2013-06-23 21:30 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 Documentation/ABI/testing/sysfs-bus-iio | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 2e33dc6..0af1af0 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -351,6 +351,7 @@ Description:
 		6kohm_to_gnd: connected to ground via a 6kOhm resistor,
 		20kohm_to_gnd: connected to ground via a 20kOhm resistor,
 		100kohm_to_gnd: connected to ground via an 100kOhm resistor,
+		500kohm_to_gnd: connected to ground via an 100kOhm resistor,
 		three_state: left floating.
 		For a list of available output power down options read
 		outX_powerdown_mode_available. If Y is not present the
-- 
1.8.3.1


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

* [PATCH 4/4] iio: move ABI specification for store_eeprom; is used by ad9523, mcp4725 and ds1077 devices
  2013-06-23 21:30 [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Peter Meerwald
  2013-06-23 21:30 ` [PATCH 2/4] iio: add powerdown to mcp4725 dac drive Peter Meerwald
  2013-06-23 21:30 ` [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes Peter Meerwald
@ 2013-06-23 21:30 ` Peter Meerwald
  2013-06-29 12:23   ` Jonathan Cameron
  2013-06-24 16:05 ` [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Jonathan Cameron
  2013-06-29 12:22 ` Jonathan Cameron
  4 siblings, 1 reply; 13+ messages in thread
From: Peter Meerwald @ 2013-06-23 21:30 UTC (permalink / raw)
  To: linux-iio; +Cc: Peter Meerwald, Lars-Peter Clausen

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 Documentation/ABI/testing/sysfs-bus-iio                  | 8 ++++++++
 Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523 | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 0af1af0..d43ca5c 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -793,3 +793,11 @@ Contact:	linux-iio@vger.kernel.org
 Description:
 		This attribute is used to read the amount of quadrature error
 		present in the device at a given time.
+
+What:		/sys/bus/iio/devices/iio:deviceX/store_eeprom
+KernelVersion:	3.4.0
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Writing '1' stores the current device configuration into
+		on-chip EEPROM. After power-up or chip reset the device will
+		automatically load the saved configuration.
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523 b/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
index 2ce9c3f..a91aeab 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
+++ b/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
@@ -18,14 +18,6 @@ Description:
 		Reading returns either '1' or '0'. '1' means that the
 		pllY is locked.
 
-What:		/sys/bus/iio/devices/iio:deviceX/store_eeprom
-KernelVersion:	3.4.0
-Contact:	linux-iio@vger.kernel.org
-Description:
-		Writing '1' stores the current device configuration into
-		on-chip EEPROM. After power-up or chip reset the device will
-		automatically load the saved configuration.
-
 What:		/sys/bus/iio/devices/iio:deviceX/sync_dividers
 KernelVersion:	3.4.0
 Contact:	linux-iio@vger.kernel.org
-- 
1.8.3.1


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

* Re: [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver
  2013-06-23 21:30 [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Peter Meerwald
                   ` (2 preceding siblings ...)
  2013-06-23 21:30 ` [PATCH 4/4] iio: move ABI specification for store_eeprom; is used by ad9523, mcp4725 and ds1077 devices Peter Meerwald
@ 2013-06-24 16:05 ` Jonathan Cameron
  2013-06-24 16:10   ` Peter Meerwald
  2013-06-29 12:22 ` Jonathan Cameron
  4 siblings, 1 reply; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-24 16:05 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio



Peter Meerwald <pmeerw@pmeerw.net> wrote:

>Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>

Abi docs?
>---
>drivers/iio/dac/mcp4725.c | 64
>+++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 62 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
>index a612ec7..cb9db90 100644
>--- a/drivers/iio/dac/mcp4725.c
>+++ b/drivers/iio/dac/mcp4725.c
>@@ -12,14 +12,13 @@
>* driver for the Microchip I2C 12-bit digital-to-analog converter (DAC)
>  * (7-bit I2C slave address 0x60, the three LSBs can be configured in
>  * hardware)
>- *
>- * writing the DAC value to EEPROM is not supported
>  */
> 
> #include <linux/module.h>
> #include <linux/init.h>
> #include <linux/i2c.h>
> #include <linux/err.h>
>+#include <linux/delay.h>
> 
> #include <linux/iio/iio.h>
> #include <linux/iio/sysfs.h>
>@@ -64,6 +63,66 @@ static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops,
>mcp4725_suspend, mcp4725_resume);
> #define MCP4725_PM_OPS NULL
> #endif
> 
>+static int mcp4725_store_eeprom(struct device *dev,
>+	struct device_attribute *attr, const char *buf, size_t len)
>+{
>+	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>+	struct mcp4725_data *data = iio_priv(indio_dev);
>+	int tries = 20;
>+	u8 inoutbuf[3];
>+	bool state;
>+	int ret;
>+
>+	ret = strtobool(buf, &state);
>+	if (ret < 0)
>+		return ret;
>+
>+	if (!state)
>+		return 0;
>+
>+	inoutbuf[0] = 0x60; /* write EEPROM */
>+	inoutbuf[1] = data->dac_value >> 4;
>+	inoutbuf[2] = (data->dac_value & 0xf) << 4;
>+
>+	ret = i2c_master_send(data->client, inoutbuf, 3);
>+	if (ret < 0)
>+		return ret;
>+	else if (ret != 3)
>+		return -EIO;
>+
>+	/* wait for write complete, takes up to 50ms */
>+	while (tries--) {
>+		msleep(20);
>+		ret = i2c_master_recv(data->client, inoutbuf, 3);
>+		if (ret < 0)
>+			return ret;
>+		else if (ret != 3)
>+			return -EIO;
>+
>+		if (inoutbuf[0] & 0x80)
>+			break;
>+	}
>+
>+	if (tries < 0) {
>+		dev_err(&data->client->dev,
>+			"mcp4725_store_eeprom() failed, incomplete\n");
>+		return -EIO;
>+	}
>+
>+	return len;
>+}
>+
>+static IIO_DEVICE_ATTR(store_eeprom, S_IWUSR, NULL,
>mcp4725_store_eeprom, 0);
>+
>+static struct attribute *mcp4725_attributes[] = {
>+	&iio_dev_attr_store_eeprom.dev_attr.attr,
>+	NULL,
>+};
>+
>+static const struct attribute_group mcp4725_attribute_group = {
>+	.attrs = mcp4725_attributes,
>+};
>+
> static const struct iio_chan_spec mcp4725_channel = {
> 	.type		= IIO_VOLTAGE,
> 	.indexed	= 1,
>@@ -138,6 +197,7 @@ static int mcp4725_write_raw(struct iio_dev
>*indio_dev,
> static const struct iio_info mcp4725_info = {
> 	.read_raw = mcp4725_read_raw,
> 	.write_raw = mcp4725_write_raw,
>+	.attrs = &mcp4725_attribute_group,
> 	.driver_module = THIS_MODULE,
> };
> 

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver
  2013-06-24 16:05 ` [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Jonathan Cameron
@ 2013-06-24 16:10   ` Peter Meerwald
  2013-06-24 16:14     ` Jonathan Cameron
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Meerwald @ 2013-06-24 16:10 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio


> >Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> 
> Abi docs?

see patch 4 of the series, http://thread.gmane.org/gmane.linux.kernel.iio/7834

the idea is to move store_eeprom from 
Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
to
Documentation/ABI/testing/sysfs-bus-iio
i.e. reuse existing ABI

p.

> >---
> >drivers/iio/dac/mcp4725.c | 64
> >+++++++++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 62 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
> >index a612ec7..cb9db90 100644
> >--- a/drivers/iio/dac/mcp4725.c
> >+++ b/drivers/iio/dac/mcp4725.c
> >@@ -12,14 +12,13 @@
> >* driver for the Microchip I2C 12-bit digital-to-analog converter (DAC)
> >  * (7-bit I2C slave address 0x60, the three LSBs can be configured in
> >  * hardware)
> >- *
> >- * writing the DAC value to EEPROM is not supported
> >  */
> > 
> > #include <linux/module.h>
> > #include <linux/init.h>
> > #include <linux/i2c.h>
> > #include <linux/err.h>
> >+#include <linux/delay.h>
> > 
> > #include <linux/iio/iio.h>
> > #include <linux/iio/sysfs.h>
> >@@ -64,6 +63,66 @@ static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops,
> >mcp4725_suspend, mcp4725_resume);
> > #define MCP4725_PM_OPS NULL
> > #endif
> > 
> >+static int mcp4725_store_eeprom(struct device *dev,
> >+	struct device_attribute *attr, const char *buf, size_t len)
> >+{
> >+	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> >+	struct mcp4725_data *data = iio_priv(indio_dev);
> >+	int tries = 20;
> >+	u8 inoutbuf[3];
> >+	bool state;
> >+	int ret;
> >+
> >+	ret = strtobool(buf, &state);
> >+	if (ret < 0)
> >+		return ret;
> >+
> >+	if (!state)
> >+		return 0;
> >+
> >+	inoutbuf[0] = 0x60; /* write EEPROM */
> >+	inoutbuf[1] = data->dac_value >> 4;
> >+	inoutbuf[2] = (data->dac_value & 0xf) << 4;
> >+
> >+	ret = i2c_master_send(data->client, inoutbuf, 3);
> >+	if (ret < 0)
> >+		return ret;
> >+	else if (ret != 3)
> >+		return -EIO;
> >+
> >+	/* wait for write complete, takes up to 50ms */
> >+	while (tries--) {
> >+		msleep(20);
> >+		ret = i2c_master_recv(data->client, inoutbuf, 3);
> >+		if (ret < 0)
> >+			return ret;
> >+		else if (ret != 3)
> >+			return -EIO;
> >+
> >+		if (inoutbuf[0] & 0x80)
> >+			break;
> >+	}
> >+
> >+	if (tries < 0) {
> >+		dev_err(&data->client->dev,
> >+			"mcp4725_store_eeprom() failed, incomplete\n");
> >+		return -EIO;
> >+	}
> >+
> >+	return len;
> >+}
> >+
> >+static IIO_DEVICE_ATTR(store_eeprom, S_IWUSR, NULL,
> >mcp4725_store_eeprom, 0);
> >+
> >+static struct attribute *mcp4725_attributes[] = {
> >+	&iio_dev_attr_store_eeprom.dev_attr.attr,
> >+	NULL,
> >+};
> >+
> >+static const struct attribute_group mcp4725_attribute_group = {
> >+	.attrs = mcp4725_attributes,
> >+};
> >+
> > static const struct iio_chan_spec mcp4725_channel = {
> > 	.type		= IIO_VOLTAGE,
> > 	.indexed	= 1,
> >@@ -138,6 +197,7 @@ static int mcp4725_write_raw(struct iio_dev
> >*indio_dev,
> > static const struct iio_info mcp4725_info = {
> > 	.read_raw = mcp4725_read_raw,
> > 	.write_raw = mcp4725_write_raw,
> >+	.attrs = &mcp4725_attribute_group,
> > 	.driver_module = THIS_MODULE,
> > };
> > 
> 
> 

-- 

Peter Meerwald
+43-664-2444418 (mobile)

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

* Re: [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver
  2013-06-24 16:10   ` Peter Meerwald
@ 2013-06-24 16:14     ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-24 16:14 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio



Peter Meerwald <pmeerw@pmeerw.net> wrote:

>
>> >Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
>> 
>> Abi docs?
>
>see patch 4 of the series,
>http://thread.gmane.org/gmane.linux.kernel.iio/7834
>
>the idea is to move store_eeprom from 
>Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
>to
>Documentation/ABI/testing/sysfs-bus-iio
>i.e. reuse existing ABI
Fair enough! Sorry..
>
>p.
>
>> >---
>> >drivers/iio/dac/mcp4725.c | 64
>> >+++++++++++++++++++++++++++++++++++++++++++++--
>> > 1 file changed, 62 insertions(+), 2 deletions(-)
>> >
>> >diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
>> >index a612ec7..cb9db90 100644
>> >--- a/drivers/iio/dac/mcp4725.c
>> >+++ b/drivers/iio/dac/mcp4725.c
>> >@@ -12,14 +12,13 @@
>> >* driver for the Microchip I2C 12-bit digital-to-analog converter
>(DAC)
>> >  * (7-bit I2C slave address 0x60, the three LSBs can be configured
>in
>> >  * hardware)
>> >- *
>> >- * writing the DAC value to EEPROM is not supported
>> >  */
>> > 
>> > #include <linux/module.h>
>> > #include <linux/init.h>
>> > #include <linux/i2c.h>
>> > #include <linux/err.h>
>> >+#include <linux/delay.h>
>> > 
>> > #include <linux/iio/iio.h>
>> > #include <linux/iio/sysfs.h>
>> >@@ -64,6 +63,66 @@ static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops,
>> >mcp4725_suspend, mcp4725_resume);
>> > #define MCP4725_PM_OPS NULL
>> > #endif
>> > 
>> >+static int mcp4725_store_eeprom(struct device *dev,
>> >+	struct device_attribute *attr, const char *buf, size_t len)
>> >+{
>> >+	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>> >+	struct mcp4725_data *data = iio_priv(indio_dev);
>> >+	int tries = 20;
>> >+	u8 inoutbuf[3];
>> >+	bool state;
>> >+	int ret;
>> >+
>> >+	ret = strtobool(buf, &state);
>> >+	if (ret < 0)
>> >+		return ret;
>> >+
>> >+	if (!state)
>> >+		return 0;
>> >+
>> >+	inoutbuf[0] = 0x60; /* write EEPROM */
>> >+	inoutbuf[1] = data->dac_value >> 4;
>> >+	inoutbuf[2] = (data->dac_value & 0xf) << 4;
>> >+
>> >+	ret = i2c_master_send(data->client, inoutbuf, 3);
>> >+	if (ret < 0)
>> >+		return ret;
>> >+	else if (ret != 3)
>> >+		return -EIO;
>> >+
>> >+	/* wait for write complete, takes up to 50ms */
>> >+	while (tries--) {
>> >+		msleep(20);
>> >+		ret = i2c_master_recv(data->client, inoutbuf, 3);
>> >+		if (ret < 0)
>> >+			return ret;
>> >+		else if (ret != 3)
>> >+			return -EIO;
>> >+
>> >+		if (inoutbuf[0] & 0x80)
>> >+			break;
>> >+	}
>> >+
>> >+	if (tries < 0) {
>> >+		dev_err(&data->client->dev,
>> >+			"mcp4725_store_eeprom() failed, incomplete\n");
>> >+		return -EIO;
>> >+	}
>> >+
>> >+	return len;
>> >+}
>> >+
>> >+static IIO_DEVICE_ATTR(store_eeprom, S_IWUSR, NULL,
>> >mcp4725_store_eeprom, 0);
>> >+
>> >+static struct attribute *mcp4725_attributes[] = {
>> >+	&iio_dev_attr_store_eeprom.dev_attr.attr,
>> >+	NULL,
>> >+};
>> >+
>> >+static const struct attribute_group mcp4725_attribute_group = {
>> >+	.attrs = mcp4725_attributes,
>> >+};
>> >+
>> > static const struct iio_chan_spec mcp4725_channel = {
>> > 	.type		= IIO_VOLTAGE,
>> > 	.indexed	= 1,
>> >@@ -138,6 +197,7 @@ static int mcp4725_write_raw(struct iio_dev
>> >*indio_dev,
>> > static const struct iio_info mcp4725_info = {
>> > 	.read_raw = mcp4725_read_raw,
>> > 	.write_raw = mcp4725_write_raw,
>> >+	.attrs = &mcp4725_attribute_group,
>> > 	.driver_module = THIS_MODULE,
>> > };
>> > 
>> 
>> 

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver
  2013-06-23 21:30 [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Peter Meerwald
                   ` (3 preceding siblings ...)
  2013-06-24 16:05 ` [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Jonathan Cameron
@ 2013-06-29 12:22 ` Jonathan Cameron
  4 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-29 12:22 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio

On 06/23/2013 10:30 PM, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied to the togreg branch of iio.git
> ---
>  drivers/iio/dac/mcp4725.c | 64 +++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 62 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
> index a612ec7..cb9db90 100644
> --- a/drivers/iio/dac/mcp4725.c
> +++ b/drivers/iio/dac/mcp4725.c
> @@ -12,14 +12,13 @@
>   * driver for the Microchip I2C 12-bit digital-to-analog converter (DAC)
>   * (7-bit I2C slave address 0x60, the three LSBs can be configured in
>   * hardware)
> - *
> - * writing the DAC value to EEPROM is not supported
>   */
>  
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/i2c.h>
>  #include <linux/err.h>
> +#include <linux/delay.h>
>  
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> @@ -64,6 +63,66 @@ static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume);
>  #define MCP4725_PM_OPS NULL
>  #endif
>  
> +static int mcp4725_store_eeprom(struct device *dev,
> +	struct device_attribute *attr, const char *buf, size_t len)
> +{
> +	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> +	struct mcp4725_data *data = iio_priv(indio_dev);
> +	int tries = 20;
> +	u8 inoutbuf[3];
> +	bool state;
> +	int ret;
> +
> +	ret = strtobool(buf, &state);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (!state)
> +		return 0;
> +
> +	inoutbuf[0] = 0x60; /* write EEPROM */
> +	inoutbuf[1] = data->dac_value >> 4;
> +	inoutbuf[2] = (data->dac_value & 0xf) << 4;
> +
> +	ret = i2c_master_send(data->client, inoutbuf, 3);
> +	if (ret < 0)
> +		return ret;
> +	else if (ret != 3)
> +		return -EIO;
> +
> +	/* wait for write complete, takes up to 50ms */
> +	while (tries--) {
> +		msleep(20);
> +		ret = i2c_master_recv(data->client, inoutbuf, 3);
> +		if (ret < 0)
> +			return ret;
> +		else if (ret != 3)
> +			return -EIO;
> +
> +		if (inoutbuf[0] & 0x80)
> +			break;
> +	}
> +
> +	if (tries < 0) {
> +		dev_err(&data->client->dev,
> +			"mcp4725_store_eeprom() failed, incomplete\n");
> +		return -EIO;
> +	}
> +
> +	return len;
> +}
> +
> +static IIO_DEVICE_ATTR(store_eeprom, S_IWUSR, NULL, mcp4725_store_eeprom, 0);
> +
> +static struct attribute *mcp4725_attributes[] = {
> +	&iio_dev_attr_store_eeprom.dev_attr.attr,
> +	NULL,
> +};
> +
> +static const struct attribute_group mcp4725_attribute_group = {
> +	.attrs = mcp4725_attributes,
> +};
> +
>  static const struct iio_chan_spec mcp4725_channel = {
>  	.type		= IIO_VOLTAGE,
>  	.indexed	= 1,
> @@ -138,6 +197,7 @@ static int mcp4725_write_raw(struct iio_dev *indio_dev,
>  static const struct iio_info mcp4725_info = {
>  	.read_raw = mcp4725_read_raw,
>  	.write_raw = mcp4725_write_raw,
> +	.attrs = &mcp4725_attribute_group,
>  	.driver_module = THIS_MODULE,
>  };
>  
> 

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

* Re: [PATCH 2/4] iio: add powerdown to mcp4725 dac drive
  2013-06-23 21:30 ` [PATCH 2/4] iio: add powerdown to mcp4725 dac drive Peter Meerwald
@ 2013-06-29 12:23   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-29 12:23 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio

On 06/23/2013 10:30 PM, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied to the togreg branch iio.git
> ---
>  drivers/iio/dac/mcp4725.c | 87 +++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 85 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
> index cb9db90..f569738 100644
> --- a/drivers/iio/dac/mcp4725.c
> +++ b/drivers/iio/dac/mcp4725.c
> @@ -31,15 +31,19 @@ struct mcp4725_data {
>  	struct i2c_client *client;
>  	u16 vref_mv;
>  	u16 dac_value;
> +	bool powerdown;
> +	unsigned powerdown_mode;
>  };
>  
> -#ifdef CONFIG_PM_SLEEP
>  static int mcp4725_suspend(struct device *dev)
>  {
> +	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> +	struct mcp4725_data *data = iio_priv(indio_dev);
>  	u8 outbuf[2];
>  
> -	outbuf[0] = 0x3 << 4; /* power-down bits, 500 kOhm resistor */
> +	outbuf[0] = (data->powerdown_mode + 1) << 4;
>  	outbuf[1] = 0;
> +	data->powerdown = true;
>  
>  	return i2c_master_send(to_i2c_client(dev), outbuf, 2);
>  }
> @@ -53,10 +57,12 @@ static int mcp4725_resume(struct device *dev)
>  	/* restore previous DAC value */
>  	outbuf[0] = (data->dac_value >> 8) & 0xf;
>  	outbuf[1] = data->dac_value & 0xff;
> +	data->powerdown = false;
>  
>  	return i2c_master_send(to_i2c_client(dev), outbuf, 2);
>  }
>  
> +#ifdef CONFIG_PM_SLEEP
>  static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume);
>  #define MCP4725_PM_OPS (&mcp4725_pm_ops)
>  #else
> @@ -123,6 +129,78 @@ static const struct attribute_group mcp4725_attribute_group = {
>  	.attrs = mcp4725_attributes,
>  };
>  
> +static const char * const mcp4725_powerdown_modes[] = {
> +	"1kohm_to_gnd",
> +	"100kohm_to_gnd",
> +	"500kohm_to_gnd"
> +};
> +
> +static int mcp4725_get_powerdown_mode(struct iio_dev *indio_dev,
> +	const struct iio_chan_spec *chan)
> +{
> +	struct mcp4725_data *data = iio_priv(indio_dev);
> +
> +	return data->powerdown_mode;
> +}
> +
> +static int mcp4725_set_powerdown_mode(struct iio_dev *indio_dev,
> +	const struct iio_chan_spec *chan, unsigned mode)
> +{
> +	struct mcp4725_data *data = iio_priv(indio_dev);
> +
> +	data->powerdown_mode = mode;
> +
> +	return 0;
> +}
> +
> +static ssize_t mcp4725_read_powerdown(struct iio_dev *indio_dev,
> +	uintptr_t private, const struct iio_chan_spec *chan, char *buf)
> +{
> +	struct mcp4725_data *data = iio_priv(indio_dev);
> +
> +	return sprintf(buf, "%d\n", data->powerdown);
> +}
> +
> +static ssize_t mcp4725_write_powerdown(struct iio_dev *indio_dev,
> +	 uintptr_t private, const struct iio_chan_spec *chan,
> +	 const char *buf, size_t len)
> +{
> +	struct mcp4725_data *data = iio_priv(indio_dev);
> +	bool state;
> +	int ret;
> +
> +	ret = strtobool(buf, &state);
> +	if (ret)
> +		return ret;
> +
> +	if (state)
> +		ret = mcp4725_suspend(&data->client->dev);
> +	else
> +		ret = mcp4725_resume(&data->client->dev);
> +	if (ret < 0)
> +		return ret;
> +
> +	return len;
> +}
> +
> +static const struct iio_enum mcp4725_powerdown_mode_enum = {
> +	.items = mcp4725_powerdown_modes,
> +	.num_items = ARRAY_SIZE(mcp4725_powerdown_modes),
> +	.get = mcp4725_get_powerdown_mode,
> +	.set = mcp4725_set_powerdown_mode,
> +};
> +
> +static const struct iio_chan_spec_ext_info mcp4725_ext_info[] = {
> +	{
> +		.name = "powerdown",
> +		.read = mcp4725_read_powerdown,
> +		.write = mcp4725_write_powerdown,
> +	},
> +	IIO_ENUM("powerdown_mode", false, &mcp4725_powerdown_mode_enum),
> +	IIO_ENUM_AVAILABLE("powerdown_mode", &mcp4725_powerdown_mode_enum),
> +	{ },
> +};
> +
>  static const struct iio_chan_spec mcp4725_channel = {
>  	.type		= IIO_VOLTAGE,
>  	.indexed	= 1,
> @@ -131,6 +209,7 @@ static const struct iio_chan_spec mcp4725_channel = {
>  	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
>  	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
>  	.scan_type	= IIO_ST('u', 12, 16, 0),
> +	.ext_info	= mcp4725_ext_info,
>  };
>  
>  static int mcp4725_set_value(struct iio_dev *indio_dev, int val)
> @@ -208,6 +287,7 @@ static int mcp4725_probe(struct i2c_client *client,
>  	struct iio_dev *indio_dev;
>  	struct mcp4725_platform_data *platform_data = client->dev.platform_data;
>  	u8 inbuf[3];
> +	u8 pd;
>  	int err;
>  
>  	if (!platform_data || !platform_data->vref_mv) {
> @@ -239,6 +319,9 @@ static int mcp4725_probe(struct i2c_client *client,
>  		dev_err(&client->dev, "failed to read DAC value");
>  		goto exit_free_device;
>  	}
> +	pd = (inbuf[0] >> 1) & 0x3;
> +	data->powerdown = pd > 0 ? true : false;
> +	data->powerdown_mode = pd ? pd-1 : 2; /* 500kohm_to_gnd */
>  	data->dac_value = (inbuf[1] << 4) | (inbuf[2] >> 4);
>  
>  	err = iio_device_register(indio_dev);
> 

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

* Re: [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes
  2013-06-23 21:30 ` [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes Peter Meerwald
@ 2013-06-29 12:23   ` Jonathan Cameron
  2013-06-29 13:32     ` Lars-Peter Clausen
  0 siblings, 1 reply; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-29 12:23 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio

On 06/23/2013 10:30 PM, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
applied to the togreg branch of iio.git
> ---
>  Documentation/ABI/testing/sysfs-bus-iio | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 2e33dc6..0af1af0 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -351,6 +351,7 @@ Description:
>  		6kohm_to_gnd: connected to ground via a 6kOhm resistor,
>  		20kohm_to_gnd: connected to ground via a 20kOhm resistor,
>  		100kohm_to_gnd: connected to ground via an 100kOhm resistor,
> +		500kohm_to_gnd: connected to ground via an 100kOhm resistor,
>  		three_state: left floating.
>  		For a list of available output power down options read
>  		outX_powerdown_mode_available. If Y is not present the
> 

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

* Re: [PATCH 4/4] iio: move ABI specification for store_eeprom; is used by ad9523, mcp4725 and ds1077 devices
  2013-06-23 21:30 ` [PATCH 4/4] iio: move ABI specification for store_eeprom; is used by ad9523, mcp4725 and ds1077 devices Peter Meerwald
@ 2013-06-29 12:23   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-29 12:23 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio, Lars-Peter Clausen

On 06/23/2013 10:30 PM, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
Applied to the togreg branch of iio.git
> ---
>  Documentation/ABI/testing/sysfs-bus-iio                  | 8 ++++++++
>  Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523 | 8 --------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 0af1af0..d43ca5c 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -793,3 +793,11 @@ Contact:	linux-iio@vger.kernel.org
>  Description:
>  		This attribute is used to read the amount of quadrature error
>  		present in the device at a given time.
> +
> +What:		/sys/bus/iio/devices/iio:deviceX/store_eeprom
> +KernelVersion:	3.4.0
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Writing '1' stores the current device configuration into
> +		on-chip EEPROM. After power-up or chip reset the device will
> +		automatically load the saved configuration.
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523 b/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
> index 2ce9c3f..a91aeab 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
> +++ b/Documentation/ABI/testing/sysfs-bus-iio-frequency-ad9523
> @@ -18,14 +18,6 @@ Description:
>  		Reading returns either '1' or '0'. '1' means that the
>  		pllY is locked.
>  
> -What:		/sys/bus/iio/devices/iio:deviceX/store_eeprom
> -KernelVersion:	3.4.0
> -Contact:	linux-iio@vger.kernel.org
> -Description:
> -		Writing '1' stores the current device configuration into
> -		on-chip EEPROM. After power-up or chip reset the device will
> -		automatically load the saved configuration.
> -
>  What:		/sys/bus/iio/devices/iio:deviceX/sync_dividers
>  KernelVersion:	3.4.0
>  Contact:	linux-iio@vger.kernel.org
> 

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

* Re: [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes
  2013-06-29 12:23   ` Jonathan Cameron
@ 2013-06-29 13:32     ` Lars-Peter Clausen
  2013-06-29 15:13       ` Jonathan Cameron
  0 siblings, 1 reply; 13+ messages in thread
From: Lars-Peter Clausen @ 2013-06-29 13:32 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Peter Meerwald, linux-iio

On 06/29/2013 02:23 PM, Jonathan Cameron wrote:
> On 06/23/2013 10:30 PM, Peter Meerwald wrote:
>> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> applied to the togreg branch of iio.git
>> ---
>>  Documentation/ABI/testing/sysfs-bus-iio | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
>> index 2e33dc6..0af1af0 100644
>> --- a/Documentation/ABI/testing/sysfs-bus-iio
>> +++ b/Documentation/ABI/testing/sysfs-bus-iio
>> @@ -351,6 +351,7 @@ Description:
>>  		6kohm_to_gnd: connected to ground via a 6kOhm resistor,
>>  		20kohm_to_gnd: connected to ground via a 20kOhm resistor,
>>  		100kohm_to_gnd: connected to ground via an 100kOhm resistor,
>> +		500kohm_to_gnd: connected to ground via an 100kOhm resistor,

I missed this earlier, there's a typo here, it should obviously be 'via an
500kOhm resistor'

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

* Re: [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes
  2013-06-29 13:32     ` Lars-Peter Clausen
@ 2013-06-29 15:13       ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2013-06-29 15:13 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Peter Meerwald, linux-iio

On 06/29/2013 02:32 PM, Lars-Peter Clausen wrote:
> On 06/29/2013 02:23 PM, Jonathan Cameron wrote:
>> On 06/23/2013 10:30 PM, Peter Meerwald wrote:
>>> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
>> applied to the togreg branch of iio.git
>>> ---
>>>  Documentation/ABI/testing/sysfs-bus-iio | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
>>> index 2e33dc6..0af1af0 100644
>>> --- a/Documentation/ABI/testing/sysfs-bus-iio
>>> +++ b/Documentation/ABI/testing/sysfs-bus-iio
>>> @@ -351,6 +351,7 @@ Description:
>>>  		6kohm_to_gnd: connected to ground via a 6kOhm resistor,
>>>  		20kohm_to_gnd: connected to ground via a 20kOhm resistor,
>>>  		100kohm_to_gnd: connected to ground via an 100kOhm resistor,
>>> +		500kohm_to_gnd: connected to ground via an 100kOhm resistor,
> 
> I missed this earlier, there's a typo here, it should obviously be 'via an
> 500kOhm resistor'
> 
doh, I'll fix that and force a push to the tree.

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

end of thread, other threads:[~2013-06-29 15:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-23 21:30 [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Peter Meerwald
2013-06-23 21:30 ` [PATCH 2/4] iio: add powerdown to mcp4725 dac drive Peter Meerwald
2013-06-29 12:23   ` Jonathan Cameron
2013-06-23 21:30 ` [PATCH 3/4] iio: add DAC 500kohm_to_gnd to possible powerdown_modes Peter Meerwald
2013-06-29 12:23   ` Jonathan Cameron
2013-06-29 13:32     ` Lars-Peter Clausen
2013-06-29 15:13       ` Jonathan Cameron
2013-06-23 21:30 ` [PATCH 4/4] iio: move ABI specification for store_eeprom; is used by ad9523, mcp4725 and ds1077 devices Peter Meerwald
2013-06-29 12:23   ` Jonathan Cameron
2013-06-24 16:05 ` [PATCH 1/4] iio: add store_eeprom to mcp4725 dac driver Jonathan Cameron
2013-06-24 16:10   ` Peter Meerwald
2013-06-24 16:14     ` Jonathan Cameron
2013-06-29 12:22 ` Jonathan Cameron

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.