All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips
@ 2017-09-05  9:44 Lukas Wunner
  2017-09-05  9:44 ` [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver Lukas Wunner
  2017-09-10 15:14 ` [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips Jonathan Cameron
  0 siblings, 2 replies; 11+ messages in thread
From: Lukas Wunner @ 2017-09-05  9:44 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Andrew F. Davis, Michael Hennerich, Daniel Mack, Arnd Bergmann,
	Greg Kroah-Hartman, linux-iio

The Texas Instruments DAC081S101, DAC101S101 and DAC121S101 have the
exact same pinout, programming interface and power-down modes as the
AD5300, AD5310 and AD5320, respectively, and their datasheets declare
them "a direct replacement" for the Analog Devices chips.  This may
not be immediately obvious to a casual observer, so add them to the
supported modalias strings.

Datasheets:
http://www.ti.com/lit/ds/symlink/dac081s101.pdf
http://www.ti.com/lit/ds/symlink/dac101s101.pdf
http://www.ti.com/lit/ds/symlink/dac121s101.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5300.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5310.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5320.pdf

Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
 drivers/iio/dac/Kconfig  | 3 ++-
 drivers/iio/dac/ad5446.c | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
index 716fcb1610dd..a411b2d59510 100644
--- a/drivers/iio/dac/Kconfig
+++ b/drivers/iio/dac/Kconfig
@@ -60,7 +60,8 @@ config AD5446
 	  Say yes here to build support for Analog Devices AD5300, AD5301, AD5310,
 	  AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,
 	  AD5512A, AD5541A, AD5542A, AD5543, AD5553, AD5601, AD5602, AD5611, AD5612,
-	  AD5620, AD5621, AD5622, AD5640, AD5641, AD5660, AD5662 DACs.
+	  AD5620, AD5621, AD5622, AD5640, AD5641, AD5660, AD5662 DACs
+	  as well as Texas Instruments DAC081S101, DAC101S101, DAC121S101.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called ad5446.
diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
index c6c22f3520eb..3f6465de39de 100644
--- a/drivers/iio/dac/ad5446.c
+++ b/drivers/iio/dac/ad5446.c
@@ -460,6 +460,9 @@ static const struct spi_device_id ad5446_spi_ids[] = {
 	{"ad5660-2500", ID_AD5660_2500},
 	{"ad5660-1250", ID_AD5660_1250},
 	{"ad5662", ID_AD5662},
+	{"dac081s101", ID_AD5300}, /* compatible Texas Instruments chips */
+	{"dac101s101", ID_AD5310},
+	{"dac121s101", ID_AD5320},
 	{}
 };
 MODULE_DEVICE_TABLE(spi, ad5446_spi_ids);
-- 
2.11.0

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

* [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-05  9:44 [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips Lukas Wunner
@ 2017-09-05  9:44 ` Lukas Wunner
  2017-09-05  9:56   ` Arnd Bergmann
  2017-09-10 15:14 ` [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips Jonathan Cameron
  1 sibling, 1 reply; 11+ messages in thread
From: Lukas Wunner @ 2017-09-05  9:44 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Andrew F. Davis, Michael Hennerich, Daniel Mack, Arnd Bergmann,
	Greg Kroah-Hartman, linux-iio

The Texas Instruments DAC7512 has the exact same pinout, programming
interface and power-down modes as the Texas Instruments DAC121S101 and
Analog Devices AD5320, which are already supported by the IIO driver
ad5446.c.  Remove the duplicate misc driver.

This requires user space to migrate to the standardized IIO sysfs ABI.
(In other words, it needs to change a filename.)

The IIO driver supports the chip's features more fully, e.g. the ability
to power down the output or choose one of the available powerdown modes.

There is an oddity with the misc driver in that it initializes the SPI
slave to SPI_MODE_0, in contradiction to the datasheet which specifies
that data is latched in on the falling edge, implying that SPI_MODE_1
or SPI_MODE_2 must be used.  Another oddity is that Kconfig and the
MODULE_DESCRIPTION() claim the chip has 16-bit resolution although it
actually has 12-bit.

Datasheets:
http://www.ti.com/lit/ds/symlink/dac7512.pdf
http://www.ti.com/lit/ds/symlink/dac121s101.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5320.pdf

Cc: Daniel Mack <daniel@zonque.org>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
 arch/arm/configs/pxa_defconfig      |   3 +-
 arch/arm/configs/raumfeld_defconfig |   3 +-
 drivers/iio/dac/ad5446.c            |  10 ++++
 drivers/misc/Kconfig                |  10 ----
 drivers/misc/Makefile               |   1 -
 drivers/misc/ti_dac7512.c           | 103 ------------------------------------
 6 files changed, 14 insertions(+), 116 deletions(-)
 delete mode 100644 drivers/misc/ti_dac7512.c

diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig
index 64e3a2a8cede..1a608ec04e17 100644
--- a/arch/arm/configs/pxa_defconfig
+++ b/arch/arm/configs/pxa_defconfig
@@ -219,7 +219,8 @@ CONFIG_AD525X_DPOT_I2C=m
 CONFIG_ICS932S401=m
 CONFIG_APDS9802ALS=m
 CONFIG_ISL29003=m
-CONFIG_TI_DAC7512=m
+CONFIG_IIO=m
+CONFIG_AD5446=m
 CONFIG_EEPROM_AT24=m
 CONFIG_SENSORS_LIS3_SPI=m
 CONFIG_IDE=m
diff --git a/arch/arm/configs/raumfeld_defconfig b/arch/arm/configs/raumfeld_defconfig
index e3dc80ead465..77a56c23c6ef 100644
--- a/arch/arm/configs/raumfeld_defconfig
+++ b/arch/arm/configs/raumfeld_defconfig
@@ -37,7 +37,8 @@ CONFIG_MTD_NAND_PXA3xx=y
 CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_ISL29003=y
-CONFIG_TI_DAC7512=y
+CONFIG_IIO=y
+CONFIG_AD5446=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
index 3f6465de39de..fd26a4272fc5 100644
--- a/drivers/iio/dac/ad5446.c
+++ b/drivers/iio/dac/ad5446.c
@@ -463,10 +463,19 @@ static const struct spi_device_id ad5446_spi_ids[] = {
 	{"dac081s101", ID_AD5300}, /* compatible Texas Instruments chips */
 	{"dac101s101", ID_AD5310},
 	{"dac121s101", ID_AD5320},
+	{"dac7512", ID_AD5320},
 	{}
 };
 MODULE_DEVICE_TABLE(spi, ad5446_spi_ids);
 
+#ifdef CONFIG_OF
+static const struct of_device_id ad5446_of_ids[] = {
+	{ .compatible = "ti,dac7512" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ad5446_of_ids);
+#endif
+
 static int ad5446_spi_probe(struct spi_device *spi)
 {
 	const struct spi_device_id *id = spi_get_device_id(spi);
@@ -483,6 +492,7 @@ static int ad5446_spi_remove(struct spi_device *spi)
 static struct spi_driver ad5446_spi_driver = {
 	.driver = {
 		.name	= "ad5446",
+		.of_match_table = of_match_ptr(ad5446_of_ids),
 	},
 	.probe		= ad5446_spi_probe,
 	.remove		= ad5446_spi_remove,
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 8136dc7e863d..f1a5c2357b14 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -393,16 +393,6 @@ config SPEAR13XX_PCIE_GADGET
 	 entry will be created for that controller. User can use these
 	 sysfs node to configure PCIe EP as per his requirements.
 
-config TI_DAC7512
-	tristate "Texas Instruments DAC7512"
-	depends on SPI && SYSFS
-	help
-	  If you say yes here you get support for the Texas Instruments
-	  DAC7512 16-bit digital-to-analog converter.
-
-	  This driver can also be built as a module. If so, the module
-	  will be called ti_dac7512.
-
 config VMWARE_BALLOON
 	tristate "VMware Balloon Driver"
 	depends on VMWARE_VMCI && X86 && HYPERVISOR_GUEST
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index b0b766416306..7c8eb47177f7 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -30,7 +30,6 @@ obj-$(CONFIG_ISL29003)		+= isl29003.o
 obj-$(CONFIG_ISL29020)		+= isl29020.o
 obj-$(CONFIG_SENSORS_TSL2550)	+= tsl2550.o
 obj-$(CONFIG_DS1682)		+= ds1682.o
-obj-$(CONFIG_TI_DAC7512)	+= ti_dac7512.o
 obj-$(CONFIG_C2PORT)		+= c2port/
 obj-$(CONFIG_HMC6352)		+= hmc6352.o
 obj-y				+= eeprom/
diff --git a/drivers/misc/ti_dac7512.c b/drivers/misc/ti_dac7512.c
deleted file mode 100644
index f5456fb7d773..000000000000
--- a/drivers/misc/ti_dac7512.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *  dac7512.c - Linux kernel module for
- * 	Texas Instruments DAC7512
- *
- *  Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/module.h>
-#include <linux/spi/spi.h>
-#include <linux/of.h>
-
-static ssize_t dac7512_store_val(struct device *dev,
-				 struct device_attribute *attr,
-				 const char *buf, size_t count)
-{
-	struct spi_device *spi = to_spi_device(dev);
-	unsigned char tmp[2];
-	unsigned long val;
-	int ret;
-
-	ret = kstrtoul(buf, 10, &val);
-	if (ret)
-		return ret;
-
-	tmp[0] = val >> 8;
-	tmp[1] = val & 0xff;
-	spi_write(spi, tmp, sizeof(tmp));
-	return count;
-}
-
-static DEVICE_ATTR(value, S_IWUSR, NULL, dac7512_store_val);
-
-static struct attribute *dac7512_attributes[] = {
-	&dev_attr_value.attr,
-	NULL
-};
-
-static const struct attribute_group dac7512_attr_group = {
-	.attrs = dac7512_attributes,
-};
-
-static int dac7512_probe(struct spi_device *spi)
-{
-	int ret;
-
-	spi->bits_per_word = 8;
-	spi->mode = SPI_MODE_0;
-	ret = spi_setup(spi);
-	if (ret < 0)
-		return ret;
-
-	return sysfs_create_group(&spi->dev.kobj, &dac7512_attr_group);
-}
-
-static int dac7512_remove(struct spi_device *spi)
-{
-	sysfs_remove_group(&spi->dev.kobj, &dac7512_attr_group);
-	return 0;
-}
-
-static const struct spi_device_id dac7512_id_table[] = {
-	{ "dac7512", 0 },
-	{ }
-};
-MODULE_DEVICE_TABLE(spi, dac7512_id_table);
-
-#ifdef CONFIG_OF
-static const struct of_device_id dac7512_of_match[] = {
-	{ .compatible = "ti,dac7512", },
-	{ }
-};
-MODULE_DEVICE_TABLE(of, dac7512_of_match);
-#endif
-
-static struct spi_driver dac7512_driver = {
-	.driver = {
-		.name	= "dac7512",
-		.of_match_table = of_match_ptr(dac7512_of_match),
-	},
-	.probe	= dac7512_probe,
-	.remove	= dac7512_remove,
-	.id_table = dac7512_id_table,
-};
-
-module_spi_driver(dac7512_driver);
-
-MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
-MODULE_DESCRIPTION("DAC7512 16-bit DAC");
-MODULE_LICENSE("GPL v2");
-- 
2.11.0


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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-05  9:44 ` [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver Lukas Wunner
@ 2017-09-05  9:56   ` Arnd Bergmann
  2017-09-05 10:11     ` Lukas Wunner
  0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2017-09-05  9:56 UTC (permalink / raw)
  To: Lukas Wunner
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Andrew F. Davis, Michael Hennerich,
	Daniel Mack, Greg Kroah-Hartman, linux-iio

On Tue, Sep 5, 2017 at 11:44 AM, Lukas Wunner <lukas@wunner.de> wrote:
> The Texas Instruments DAC7512 has the exact same pinout, programming
> interface and power-down modes as the Texas Instruments DAC121S101 and
> Analog Devices AD5320, which are already supported by the IIO driver
> ad5446.c.  Remove the duplicate misc driver.
>
> This requires user space to migrate to the standardized IIO sysfs ABI.
> (In other words, it needs to change a filename.)
>
> The IIO driver supports the chip's features more fully, e.g. the ability
> to power down the output or choose one of the available powerdown modes.
>
> There is an oddity with the misc driver in that it initializes the SPI
> slave to SPI_MODE_0, in contradiction to the datasheet which specifies
> that data is latched in on the falling edge, implying that SPI_MODE_1
> or SPI_MODE_2 must be used.  Another oddity is that Kconfig and the
> MODULE_DESCRIPTION() claim the chip has 16-bit resolution although it
> actually has 12-bit.
>
> Datasheets:
> http://www.ti.com/lit/ds/symlink/dac7512.pdf
> http://www.ti.com/lit/ds/symlink/dac121s101.pdf
> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5320.pdf
>
> Cc: Daniel Mack <daniel@zonque.org>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Good catch, removing duplicate code is usually a good idea.

However, for the incompatible user space ABI change, we need a better
reasoning why this is safe to do and won't catch users by surprise.

If anyone relies on the old ABI and can't be expected to change,
we need to stay compatible. Do we know who uses the old driver?

>  arch/arm/configs/pxa_defconfig      |   3 +-
>  arch/arm/configs/raumfeld_defconfig |   3 +-
>  drivers/iio/dac/ad5446.c            |  10 ++++
>  drivers/misc/Kconfig                |  10 ----
>  drivers/misc/Makefile               |   1 -
>  drivers/misc/ti_dac7512.c           | 103 ------------------------------------
>  6 files changed, 14 insertions(+), 116 deletions(-)
>  delete mode 100644 drivers/misc/ti_dac7512.c

For the defconfig changes:

Acked-by: Arnd Bergmann <arnd@arndb.de>

> -
> -static const struct spi_device_id dac7512_id_table[] = {
> -       { "dac7512", 0 },
> -       { }
> -};
> -MODULE_DEVICE_TABLE(spi, dac7512_id_table);
> -
> -#ifdef CONFIG_OF
> -static const struct of_device_id dac7512_of_match[] = {
> -       { .compatible = "ti,dac7512", },
> -       { }
> -};

The other driver doesn't appear to have an of_match table, so
I suspect it won't automatically get loaded.

Can you update
Documentation/devicetree/bindings/iio/dac/ti,dac7512.txt
in an appropriate way to list all the IDs that are supported
by the IIO driver, and make sure that the driver supports
all the IDs that it needs?

        Arnd

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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-05  9:56   ` Arnd Bergmann
@ 2017-09-05 10:11     ` Lukas Wunner
  2017-09-05 10:28       ` Daniel Mack
  0 siblings, 1 reply; 11+ messages in thread
From: Lukas Wunner @ 2017-09-05 10:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Andrew F. Davis, Michael Hennerich,
	Daniel Mack, Greg Kroah-Hartman, linux-iio

On Tue, Sep 05, 2017 at 11:56:02AM +0200, Arnd Bergmann wrote:
> On Tue, Sep 5, 2017 at 11:44 AM, Lukas Wunner <lukas@wunner.de> wrote:
> > The Texas Instruments DAC7512 has the exact same pinout, programming
> > interface and power-down modes as the Texas Instruments DAC121S101 and
> > Analog Devices AD5320, which are already supported by the IIO driver
> > ad5446.c.  Remove the duplicate misc driver.
> >
> > This requires user space to migrate to the standardized IIO sysfs ABI.
> > (In other words, it needs to change a filename.)
> >
> > The IIO driver supports the chip's features more fully, e.g. the ability
> > to power down the output or choose one of the available powerdown modes.
> >
> > There is an oddity with the misc driver in that it initializes the SPI
> > slave to SPI_MODE_0, in contradiction to the datasheet which specifies
> > that data is latched in on the falling edge, implying that SPI_MODE_1
> > or SPI_MODE_2 must be used.  Another oddity is that Kconfig and the
> > MODULE_DESCRIPTION() claim the chip has 16-bit resolution although it
> > actually has 12-bit.
> >
> > Datasheets:
> > http://www.ti.com/lit/ds/symlink/dac7512.pdf
> > http://www.ti.com/lit/ds/symlink/dac121s101.pdf
> > http://www.analog.com/media/en/technical-documentation/data-sheets/AD5320.pdf
> >
> > Cc: Daniel Mack <daniel@zonque.org>
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> 
> Good catch, removing duplicate code is usually a good idea.
> 
> However, for the incompatible user space ABI change, we need a better
> reasoning why this is safe to do and won't catch users by surprise.
> 
> If anyone relies on the old ABI and can't be expected to change,
> we need to stay compatible. Do we know who uses the old driver?

Daniel introduced it for use in Raumfeld speakers.

The IIO subsystem predates this driver by a few months.  I don't know
why it uses a nonstandard file in sysfs and wasn't based on IIO.

I'm wondering if the driver has ever worked because of the SPI_MODE_0
issue mentioned above.  If it did, it must have been by accident.
Or the datasheet is wrong, which seems unlikely.


> > -
> > -static const struct spi_device_id dac7512_id_table[] = {
> > -       { "dac7512", 0 },
> > -       { }
> > -};
> > -MODULE_DEVICE_TABLE(spi, dac7512_id_table);
> > -
> > -#ifdef CONFIG_OF
> > -static const struct of_device_id dac7512_of_match[] = {
> > -       { .compatible = "ti,dac7512", },
> > -       { }
> > -};
> 
> The other driver doesn't appear to have an of_match table, so
> I suspect it won't automatically get loaded.

I added one in this patch, check again.


> Can you update
> Documentation/devicetree/bindings/iio/dac/ti,dac7512.txt
> in an appropriate way to list all the IDs that are supported
> by the IIO driver, and make sure that the driver supports
> all the IDs that it needs?

There are no DT bindings documented for ad5446.c, so I left
this file as is, its contents continue to apply.

I guess I could amend the newly introduced OF match table with
all existing SPI IDs supported by ad5446.c and document those
in the DT bindings if desired?

Thanks,

Lukas

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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-05 10:11     ` Lukas Wunner
@ 2017-09-05 10:28       ` Daniel Mack
  2017-09-05 13:01         ` Arnd Bergmann
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Mack @ 2017-09-05 10:28 UTC (permalink / raw)
  To: Lukas Wunner, Arnd Bergmann
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Andrew F. Davis, Michael Hennerich,
	Greg Kroah-Hartman, linux-iio

On 09/05/2017 12:11 PM, Lukas Wunner wrote:
> On Tue, Sep 05, 2017 at 11:56:02AM +0200, Arnd Bergmann wrote:
>> On Tue, Sep 5, 2017 at 11:44 AM, Lukas Wunner <lukas@wunner.de> wrote:
>>> The Texas Instruments DAC7512 has the exact same pinout, programming
>>> interface and power-down modes as the Texas Instruments DAC121S101 and
>>> Analog Devices AD5320, which are already supported by the IIO driver
>>> ad5446.c.  Remove the duplicate misc driver.
>>>
>>> This requires user space to migrate to the standardized IIO sysfs ABI.
>>> (In other words, it needs to change a filename.)
>>>
>>> The IIO driver supports the chip's features more fully, e.g. the ability
>>> to power down the output or choose one of the available powerdown modes.
>>>
>>> There is an oddity with the misc driver in that it initializes the SPI
>>> slave to SPI_MODE_0, in contradiction to the datasheet which specifies
>>> that data is latched in on the falling edge, implying that SPI_MODE_1
>>> or SPI_MODE_2 must be used.  Another oddity is that Kconfig and the
>>> MODULE_DESCRIPTION() claim the chip has 16-bit resolution although it
>>> actually has 12-bit.
>>>
>>> Datasheets:
>>> http://www.ti.com/lit/ds/symlink/dac7512.pdf
>>> http://www.ti.com/lit/ds/symlink/dac121s101.pdf
>>> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5320.pdf
>>>
>>> Cc: Daniel Mack <daniel@zonque.org>
>>> Signed-off-by: Lukas Wunner <lukas@wunner.de>
>> Good catch, removing duplicate code is usually a good idea.
>>
>> However, for the incompatible user space ABI change, we need a better
>> reasoning why this is safe to do and won't catch users by surprise.
>>
>> If anyone relies on the old ABI and can't be expected to change,
>> we need to stay compatible. Do we know who uses the old driver?
> Daniel introduced it for use in Raumfeld speakers.
> 
> The IIO subsystem predates this driver by a few months.  I don't know
> why it uses a nonstandard file in sysfs and wasn't based on IIO.
> 
> I'm wondering if the driver has ever worked because of the SPI_MODE_0
> issue mentioned above.  If it did, it must have been by accident.
> Or the datasheet is wrong, which seems unlikely.

That's true, but the devices that do are EOL for a long time, and they
don't use mainline kernels anyway, for multiple reasons. So that
shouldn't constrain us, and I'm all for replacing that driver with
something that has a real infrastructure.

  Acked-by: Daniel Mack <daniel@zonque.org>


Thanks,
Daniel

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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-05 10:28       ` Daniel Mack
@ 2017-09-05 13:01         ` Arnd Bergmann
  2017-09-10 15:19           ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2017-09-05 13:01 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Lukas Wunner, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Andrew F. Davis,
	Michael Hennerich, Greg Kroah-Hartman, linux-iio

On Tue, Sep 5, 2017 at 12:28 PM, Daniel Mack <daniel@zonque.org> wrote:
> On 09/05/2017 12:11 PM, Lukas Wunner wrote:
>> On Tue, Sep 05, 2017 at 11:56:02AM +0200, Arnd Bergmann wrote:
>>> On Tue, Sep 5, 2017 at 11:44 AM, Lukas Wunner <lukas@wunner.de> wrote:
> That's true, but the devices that do are EOL for a long time, and they
> don't use mainline kernels anyway, for multiple reasons. So that
> shouldn't constrain us, and I'm all for replacing that driver with
> something that has a real infrastructure.
>
>   Acked-by: Daniel Mack <daniel@zonque.org>

Ok, thanks for the confirmation. That's probably good enough to apply the
patch for 4.15. If someone else uses the driver without you knowing, they
can always complain later on and we revert the patch or think of an
alternative, but that seems unlikely.

       Arnd

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

* Re: [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips
  2017-09-05  9:44 [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips Lukas Wunner
  2017-09-05  9:44 ` [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver Lukas Wunner
@ 2017-09-10 15:14 ` Jonathan Cameron
  1 sibling, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2017-09-10 15:14 UTC (permalink / raw)
  To: Lukas Wunner
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Andrew F. Davis, Michael Hennerich, Daniel Mack, Arnd Bergmann,
	Greg Kroah-Hartman, linux-iio

On Tue, 5 Sep 2017 11:44:00 +0200
Lukas Wunner <lukas@wunner.de> wrote:

> The Texas Instruments DAC081S101, DAC101S101 and DAC121S101 have the
> exact same pinout, programming interface and power-down modes as the
> AD5300, AD5310 and AD5320, respectively, and their datasheets declare
> them "a direct replacement" for the Analog Devices chips.  This may
> not be immediately obvious to a casual observer, so add them to the
> supported modalias strings.
> 
> Datasheets:
> http://www.ti.com/lit/ds/symlink/dac081s101.pdf
> http://www.ti.com/lit/ds/symlink/dac101s101.pdf
> http://www.ti.com/lit/ds/symlink/dac121s101.pdf
> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5300.pdf
> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5310.pdf
> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5320.pdf
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Applied to the togreg branch of iio.git and will be pushed out as testing
for the autobuilders to play with.

Thanks,

Jonathan

> ---
>  drivers/iio/dac/Kconfig  | 3 ++-
>  drivers/iio/dac/ad5446.c | 3 +++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
> index 716fcb1610dd..a411b2d59510 100644
> --- a/drivers/iio/dac/Kconfig
> +++ b/drivers/iio/dac/Kconfig
> @@ -60,7 +60,8 @@ config AD5446
>  	  Say yes here to build support for Analog Devices AD5300, AD5301, AD5310,
>  	  AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,
>  	  AD5512A, AD5541A, AD5542A, AD5543, AD5553, AD5601, AD5602, AD5611, AD5612,
> -	  AD5620, AD5621, AD5622, AD5640, AD5641, AD5660, AD5662 DACs.
> +	  AD5620, AD5621, AD5622, AD5640, AD5641, AD5660, AD5662 DACs
> +	  as well as Texas Instruments DAC081S101, DAC101S101, DAC121S101.
>  
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called ad5446.
> diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
> index c6c22f3520eb..3f6465de39de 100644
> --- a/drivers/iio/dac/ad5446.c
> +++ b/drivers/iio/dac/ad5446.c
> @@ -460,6 +460,9 @@ static const struct spi_device_id ad5446_spi_ids[] = {
>  	{"ad5660-2500", ID_AD5660_2500},
>  	{"ad5660-1250", ID_AD5660_1250},
>  	{"ad5662", ID_AD5662},
> +	{"dac081s101", ID_AD5300}, /* compatible Texas Instruments chips */
> +	{"dac101s101", ID_AD5310},
> +	{"dac121s101", ID_AD5320},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(spi, ad5446_spi_ids);


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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-05 13:01         ` Arnd Bergmann
@ 2017-09-10 15:19           ` Jonathan Cameron
  2017-09-10 18:43             ` Lukas Wunner
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2017-09-10 15:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Mack, Lukas Wunner, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Andrew F. Davis, Michael Hennerich,
	Greg Kroah-Hartman, linux-iio

On Tue, 5 Sep 2017 15:01:08 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Tue, Sep 5, 2017 at 12:28 PM, Daniel Mack <daniel@zonque.org> wrote:
> > On 09/05/2017 12:11 PM, Lukas Wunner wrote:  
> >> On Tue, Sep 05, 2017 at 11:56:02AM +0200, Arnd Bergmann wrote:  
> >>> On Tue, Sep 5, 2017 at 11:44 AM, Lukas Wunner <lukas@wunner.de> wrote:  
> > That's true, but the devices that do are EOL for a long time, and they
> > don't use mainline kernels anyway, for multiple reasons. So that
> > shouldn't constrain us, and I'm all for replacing that driver with
> > something that has a real infrastructure.
> >
> >   Acked-by: Daniel Mack <daniel@zonque.org>  
> 
> Ok, thanks for the confirmation. That's probably good enough to apply the
> patch for 4.15. If someone else uses the driver without you knowing, they
> can always complain later on and we revert the patch or think of an
> alternative, but that seems unlikely.
> 
>        Arnd
Sounds good to me.  I'll pick it up through IIO given the small changes
there and the fact you are happy with it.  Shout if you would prefer
a different route. Given timing I won't be pushing this out on a non
rebasing tree for a week or so anyway.

Applied to the togreg branch of iio.git and pushed out as testing for
autobuilders to play with it.

Thanks,

Jonathan




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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-10 15:19           ` Jonathan Cameron
@ 2017-09-10 18:43             ` Lukas Wunner
  2017-09-11  8:41               ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Lukas Wunner @ 2017-09-10 18:43 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Arnd Bergmann, Daniel Mack, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Andrew F. Davis, Michael Hennerich,
	Greg Kroah-Hartman, linux-iio

On Sun, Sep 10, 2017 at 04:19:28PM +0100, Jonathan Cameron wrote:
> On Tue, 5 Sep 2017 15:01:08 +0200 Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tue, Sep 5, 2017 at 12:28 PM, Daniel Mack <daniel@zonque.org> wrote:
> > > That's true, but the devices that do are EOL for a long time, and they
> > > don't use mainline kernels anyway, for multiple reasons. So that
> > > shouldn't constrain us, and I'm all for replacing that driver with
> > > something that has a real infrastructure.
> > >
> > >   Acked-by: Daniel Mack <daniel@zonque.org>  
> > 
> > Ok, thanks for the confirmation. That's probably good enough to apply the
> > patch for 4.15. If someone else uses the driver without you knowing, they
> > can always complain later on and we revert the patch or think of an
> > alternative, but that seems unlikely.
> 
> Sounds good to me.  I'll pick it up through IIO given the small changes
> there and the fact you are happy with it.  Shout if you would prefer
> a different route. Given timing I won't be pushing this out on a non
> rebasing tree for a week or so anyway.
> 
> Applied to the togreg branch of iio.git and pushed out as testing for
> autobuilders to play with it.

Thank you Daniel, Arnd & Jonathan!

A minor note, the commit as pushed to iio.git/testing is missing Arnd's
Acked-by.  Also, the Cc: to Daniel is redundant given his ack.

Have a pleasant week,

Lukas

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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-10 18:43             ` Lukas Wunner
@ 2017-09-11  8:41               ` Jonathan Cameron
  2017-09-12 10:12                 ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2017-09-11  8:41 UTC (permalink / raw)
  To: Lukas Wunner
  Cc: Jonathan Cameron, Arnd Bergmann, Daniel Mack, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Andrew F. Davis,
	Michael Hennerich, Greg Kroah-Hartman, linux-iio

On Sun, 10 Sep 2017 20:43:15 +0200
Lukas Wunner <lukas@wunner.de> wrote:

> On Sun, Sep 10, 2017 at 04:19:28PM +0100, Jonathan Cameron wrote:
> > On Tue, 5 Sep 2017 15:01:08 +0200 Arnd Bergmann <arnd@arndb.de> wrote:  
> > > On Tue, Sep 5, 2017 at 12:28 PM, Daniel Mack <daniel@zonque.org> wrote:  
> > > > That's true, but the devices that do are EOL for a long time, and they
> > > > don't use mainline kernels anyway, for multiple reasons. So that
> > > > shouldn't constrain us, and I'm all for replacing that driver with
> > > > something that has a real infrastructure.
> > > >
> > > >   Acked-by: Daniel Mack <daniel@zonque.org>    
> > > 
> > > Ok, thanks for the confirmation. That's probably good enough to apply the
> > > patch for 4.15. If someone else uses the driver without you knowing, they
> > > can always complain later on and we revert the patch or think of an
> > > alternative, but that seems unlikely.  
> > 
> > Sounds good to me.  I'll pick it up through IIO given the small changes
> > there and the fact you are happy with it.  Shout if you would prefer
> > a different route. Given timing I won't be pushing this out on a non
> > rebasing tree for a week or so anyway.
> > 
> > Applied to the togreg branch of iio.git and pushed out as testing for
> > autobuilders to play with it.  
> 
> Thank you Daniel, Arnd & Jonathan!
> 
> A minor note, the commit as pushed to iio.git/testing is missing Arnd's
> Acked-by.  Also, the Cc: to Daniel is redundant given his ack.

Thanks!  I checked Arnd's last email but missed the Ack in the earlier
one.  Will tidy that up when I'm next on the right PC.

Jonathan

> 
> Have a pleasant week,
> 
> Lukas
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver
  2017-09-11  8:41               ` Jonathan Cameron
@ 2017-09-12 10:12                 ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2017-09-12 10:12 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lukas Wunner, Arnd Bergmann, Daniel Mack, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Andrew F. Davis,
	Michael Hennerich, Greg Kroah-Hartman, linux-iio

On Mon, 11 Sep 2017 09:41:05 +0100
Jonathan Cameron <Jonathan.Cameron@huawei.com> wrote:

> On Sun, 10 Sep 2017 20:43:15 +0200
> Lukas Wunner <lukas@wunner.de> wrote:
> 
> > On Sun, Sep 10, 2017 at 04:19:28PM +0100, Jonathan Cameron wrote:  
> > > On Tue, 5 Sep 2017 15:01:08 +0200 Arnd Bergmann <arnd@arndb.de> wrote:    
> > > > On Tue, Sep 5, 2017 at 12:28 PM, Daniel Mack <daniel@zonque.org> wrote:    
> > > > > That's true, but the devices that do are EOL for a long time, and they
> > > > > don't use mainline kernels anyway, for multiple reasons. So that
> > > > > shouldn't constrain us, and I'm all for replacing that driver with
> > > > > something that has a real infrastructure.
> > > > >
> > > > >   Acked-by: Daniel Mack <daniel@zonque.org>      
> > > > 
> > > > Ok, thanks for the confirmation. That's probably good enough to apply the
> > > > patch for 4.15. If someone else uses the driver without you knowing, they
> > > > can always complain later on and we revert the patch or think of an
> > > > alternative, but that seems unlikely.    
> > > 
> > > Sounds good to me.  I'll pick it up through IIO given the small changes
> > > there and the fact you are happy with it.  Shout if you would prefer
> > > a different route. Given timing I won't be pushing this out on a non
> > > rebasing tree for a week or so anyway.
> > > 
> > > Applied to the togreg branch of iio.git and pushed out as testing for
> > > autobuilders to play with it.    
> > 
> > Thank you Daniel, Arnd & Jonathan!
> > 
> > A minor note, the commit as pushed to iio.git/testing is missing Arnd's
> > Acked-by.  Also, the Cc: to Daniel is redundant given his ack.  
> 
> Thanks!  I checked Arnd's last email but missed the Ack in the earlier
> one.  Will tidy that up when I'm next on the right PC.
> 
> Jonathan
Fixed.  Thanks again.

Jonathan
> 
> > 
> > Have a pleasant week,
> > 
> > Lukas
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html  
> 


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

end of thread, other threads:[~2017-09-12 10:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05  9:44 [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips Lukas Wunner
2017-09-05  9:44 ` [PATCH 2/2] drivers: misc: ti_dac7512: Remove duplicate driver Lukas Wunner
2017-09-05  9:56   ` Arnd Bergmann
2017-09-05 10:11     ` Lukas Wunner
2017-09-05 10:28       ` Daniel Mack
2017-09-05 13:01         ` Arnd Bergmann
2017-09-10 15:19           ` Jonathan Cameron
2017-09-10 18:43             ` Lukas Wunner
2017-09-11  8:41               ` Jonathan Cameron
2017-09-12 10:12                 ` Jonathan Cameron
2017-09-10 15:14 ` [PATCH 1/2] iio: dac: ad5446: Add IDs of compatible Texas Instruments chips 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.