Skip to content

Commit 49b3f87

Browse files
l1kjic23
authored andcommitted
drivers: misc: ti_dac7512: Remove duplicate driver
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 Signed-off-by: Lukas Wunner <[email protected]> Acked-by: Daniel Mack <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 9cad3b9 commit 49b3f87

File tree

6 files changed

+14
-116
lines changed

6 files changed

+14
-116
lines changed

arch/arm/configs/pxa_defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ CONFIG_AD525X_DPOT_I2C=m
219219
CONFIG_ICS932S401=m
220220
CONFIG_APDS9802ALS=m
221221
CONFIG_ISL29003=m
222-
CONFIG_TI_DAC7512=m
222+
CONFIG_IIO=m
223+
CONFIG_AD5446=m
223224
CONFIG_EEPROM_AT24=m
224225
CONFIG_SENSORS_LIS3_SPI=m
225226
CONFIG_IDE=m

arch/arm/configs/raumfeld_defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ CONFIG_MTD_NAND_PXA3xx=y
3737
CONFIG_MTD_UBI=y
3838
CONFIG_BLK_DEV_LOOP=y
3939
CONFIG_ISL29003=y
40-
CONFIG_TI_DAC7512=y
40+
CONFIG_IIO=y
41+
CONFIG_AD5446=y
4142
CONFIG_SCSI=y
4243
CONFIG_BLK_DEV_SD=y
4344
CONFIG_CHR_DEV_SG=y

drivers/iio/dac/ad5446.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,19 @@ static const struct spi_device_id ad5446_spi_ids[] = {
463463
{"dac081s101", ID_AD5300}, /* compatible Texas Instruments chips */
464464
{"dac101s101", ID_AD5310},
465465
{"dac121s101", ID_AD5320},
466+
{"dac7512", ID_AD5320},
466467
{}
467468
};
468469
MODULE_DEVICE_TABLE(spi, ad5446_spi_ids);
469470

471+
#ifdef CONFIG_OF
472+
static const struct of_device_id ad5446_of_ids[] = {
473+
{ .compatible = "ti,dac7512" },
474+
{ }
475+
};
476+
MODULE_DEVICE_TABLE(of, ad5446_of_ids);
477+
#endif
478+
470479
static int ad5446_spi_probe(struct spi_device *spi)
471480
{
472481
const struct spi_device_id *id = spi_get_device_id(spi);
@@ -483,6 +492,7 @@ static int ad5446_spi_remove(struct spi_device *spi)
483492
static struct spi_driver ad5446_spi_driver = {
484493
.driver = {
485494
.name = "ad5446",
495+
.of_match_table = of_match_ptr(ad5446_of_ids),
486496
},
487497
.probe = ad5446_spi_probe,
488498
.remove = ad5446_spi_remove,

drivers/misc/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -393,16 +393,6 @@ config SPEAR13XX_PCIE_GADGET
393393
entry will be created for that controller. User can use these
394394
sysfs node to configure PCIe EP as per his requirements.
395395

396-
config TI_DAC7512
397-
tristate "Texas Instruments DAC7512"
398-
depends on SPI && SYSFS
399-
help
400-
If you say yes here you get support for the Texas Instruments
401-
DAC7512 16-bit digital-to-analog converter.
402-
403-
This driver can also be built as a module. If so, the module
404-
will be called ti_dac7512.
405-
406396
config VMWARE_BALLOON
407397
tristate "VMware Balloon Driver"
408398
depends on VMWARE_VMCI && X86 && HYPERVISOR_GUEST

drivers/misc/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ obj-$(CONFIG_ISL29003) += isl29003.o
3030
obj-$(CONFIG_ISL29020) += isl29020.o
3131
obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o
3232
obj-$(CONFIG_DS1682) += ds1682.o
33-
obj-$(CONFIG_TI_DAC7512) += ti_dac7512.o
3433
obj-$(CONFIG_C2PORT) += c2port/
3534
obj-$(CONFIG_HMC6352) += hmc6352.o
3635
obj-y += eeprom/

drivers/misc/ti_dac7512.c

Lines changed: 0 additions & 103 deletions
This file was deleted.

0 commit comments

Comments
 (0)