* [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon.
@ 2011-09-30 10:20 Jonathan Cameron
2011-10-05 8:39 ` Hennerich, Michael
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2011-09-30 10:20 UTC (permalink / raw)
To: linux-iio; +Cc: Device-drivers-devel, Jonathan Cameron
Driver ported over to hwmon where it fits much better.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
Technically there is a slight loss of functionality in the hwmon
driver (no power down mode).
Otherwise, lets clear this one out.
3 more to go on my removal list ;)
adt7310, adt7410 and adt75.
If anyone is bored, those are rather more effort than this one
was.
Jonathan
drivers/staging/iio/adc/Kconfig | 7 -
drivers/staging/iio/adc/Makefile | 1 -
drivers/staging/iio/adc/ad7314.c | 281 --------------------------------------
3 files changed, 0 insertions(+), 289 deletions(-)
delete mode 100644 drivers/staging/iio/adc/ad7314.c
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index 070efd3..2c1b7de 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -34,13 +34,6 @@ config AD7298
To compile this driver as a module, choose M here: the
module will be called ad7298.
-config AD7314
- tristate "Analog Devices AD7314 temperature sensor driver"
- depends on SPI
- help
- Say yes here to build support for Analog Devices AD7314
- temperature sensors.
-
config AD7606
tristate "Analog Devices AD7606 ADC driver"
depends on GPIOLIB
diff --git a/drivers/staging/iio/adc/Makefile b/drivers/staging/iio/adc/Makefile
index 8adf096..93dc84b 100644
--- a/drivers/staging/iio/adc/Makefile
+++ b/drivers/staging/iio/adc/Makefile
@@ -32,7 +32,6 @@ obj-$(CONFIG_AD7298) += ad7298.o
obj-$(CONFIG_AD7150) += ad7150.o
obj-$(CONFIG_AD7152) += ad7152.o
obj-$(CONFIG_AD7291) += ad7291.o
-obj-$(CONFIG_AD7314) += ad7314.o
obj-$(CONFIG_AD7746) += ad7746.o
obj-$(CONFIG_AD7780) += ad7780.o
obj-$(CONFIG_AD7793) += ad7793.o
diff --git a/drivers/staging/iio/adc/ad7314.c b/drivers/staging/iio/adc/ad7314.c
deleted file mode 100644
index 094a4ee..0000000
--- a/drivers/staging/iio/adc/ad7314.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * AD7314 digital temperature sensor driver for AD7314, ADT7301 and ADT7302
- *
- * Copyright 2010 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later.
- */
-
-#include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
-#include <linux/spi/spi.h>
-#include <linux/module.h>
-
-#include "../iio.h"
-#include "../sysfs.h"
-
-/*
- * AD7314 power mode
- */
-#define AD7314_PD 0x2000
-
-/*
- * AD7314 temperature masks
- */
-#define AD7314_TEMP_SIGN 0x200
-#define AD7314_TEMP_MASK 0x7FE0
-#define AD7314_TEMP_OFFSET 5
-#define AD7314_TEMP_FLOAT_OFFSET 2
-#define AD7314_TEMP_FLOAT_MASK 0x3
-
-/*
- * ADT7301 and ADT7302 temperature masks
- */
-#define ADT7301_TEMP_SIGN 0x2000
-#define ADT7301_TEMP_MASK 0x2FFF
-#define ADT7301_TEMP_FLOAT_OFFSET 5
-#define ADT7301_TEMP_FLOAT_MASK 0x1F
-
-/*
- * struct ad7314_chip_info - chip specifc information
- */
-
-struct ad7314_chip_info {
- struct spi_device *spi_dev;
- s64 last_timestamp;
- u8 mode;
-};
-
-/*
- * ad7314 register access by SPI
- */
-
-static int ad7314_spi_read(struct ad7314_chip_info *chip, u16 *data)
-{
- struct spi_device *spi_dev = chip->spi_dev;
- int ret = 0;
- u16 value;
-
- ret = spi_read(spi_dev, (u8 *)&value, sizeof(value));
- if (ret < 0) {
- dev_err(&spi_dev->dev, "SPI read error\n");
- return ret;
- }
-
- *data = be16_to_cpu((u16)value);
-
- return ret;
-}
-
-static int ad7314_spi_write(struct ad7314_chip_info *chip, u16 data)
-{
- struct spi_device *spi_dev = chip->spi_dev;
- int ret = 0;
- u16 value = cpu_to_be16(data);
-
- ret = spi_write(spi_dev, (u8 *)&value, sizeof(value));
- if (ret < 0)
- dev_err(&spi_dev->dev, "SPI write error\n");
-
- return ret;
-}
-
-static ssize_t ad7314_show_mode(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7314_chip_info *chip = iio_priv(dev_info);
-
- if (chip->mode)
- return sprintf(buf, "power-save\n");
- else
- return sprintf(buf, "full\n");
-}
-
-static ssize_t ad7314_store_mode(struct device *dev,
- struct device_attribute *attr,
- const char *buf,
- size_t len)
-{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7314_chip_info *chip = iio_priv(dev_info);
- u16 mode = 0;
- int ret;
-
- if (!strcmp(buf, "full"))
- mode = AD7314_PD;
-
- ret = ad7314_spi_write(chip, mode);
- if (ret)
- return -EIO;
-
- chip->mode = mode;
-
- return len;
-}
-
-static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
- ad7314_show_mode,
- ad7314_store_mode,
- 0);
-
-static ssize_t ad7314_show_available_modes(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- return sprintf(buf, "full\npower-save\n");
-}
-
-static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7314_show_available_modes, NULL, 0);
-
-static ssize_t ad7314_show_temperature(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7314_chip_info *chip = iio_priv(dev_info);
- u16 data;
- char sign = ' ';
- int ret;
-
- if (chip->mode) {
- ret = ad7314_spi_write(chip, 0);
- if (ret)
- return -EIO;
- }
-
- ret = ad7314_spi_read(chip, &data);
- if (ret)
- return -EIO;
-
- if (chip->mode)
- ad7314_spi_write(chip, chip->mode);
-
- if (strcmp(dev_info->name, "ad7314")) {
- data = (data & AD7314_TEMP_MASK) >>
- AD7314_TEMP_OFFSET;
- if (data & AD7314_TEMP_SIGN) {
- data = (AD7314_TEMP_SIGN << 1) - data;
- sign = '-';
- }
-
- return sprintf(buf, "%c%d.%.2d\n", sign,
- data >> AD7314_TEMP_FLOAT_OFFSET,
- (data & AD7314_TEMP_FLOAT_MASK) * 25);
- } else {
- data &= ADT7301_TEMP_MASK;
- if (data & ADT7301_TEMP_SIGN) {
- data = (ADT7301_TEMP_SIGN << 1) - data;
- sign = '-';
- }
-
- return sprintf(buf, "%c%d.%.5d\n", sign,
- data >> ADT7301_TEMP_FLOAT_OFFSET,
- (data & ADT7301_TEMP_FLOAT_MASK) * 3125);
- }
-}
-
-static IIO_DEVICE_ATTR(temperature, S_IRUGO, ad7314_show_temperature, NULL, 0);
-
-static struct attribute *ad7314_attributes[] = {
- &iio_dev_attr_available_modes.dev_attr.attr,
- &iio_dev_attr_mode.dev_attr.attr,
- &iio_dev_attr_temperature.dev_attr.attr,
- NULL,
-};
-
-static const struct attribute_group ad7314_attribute_group = {
- .attrs = ad7314_attributes,
-};
-
-static const struct iio_info ad7314_info = {
- .attrs = &ad7314_attribute_group,
- .driver_module = THIS_MODULE,
-};
-/*
- * device probe and remove
- */
-
-static int __devinit ad7314_probe(struct spi_device *spi_dev)
-{
- struct ad7314_chip_info *chip;
- struct iio_dev *indio_dev;
- int ret = 0;
-
- indio_dev = iio_allocate_device(sizeof(*chip));
- if (indio_dev == NULL) {
- ret = -ENOMEM;
- goto error_ret;
- }
- chip = iio_priv(indio_dev);
- /* this is only used for device removal purposes */
- dev_set_drvdata(&spi_dev->dev, chip);
-
- chip->spi_dev = spi_dev;
-
- indio_dev->name = spi_get_device_id(spi_dev)->name;
- indio_dev->dev.parent = &spi_dev->dev;
- indio_dev->info = &ad7314_info;
-
- ret = iio_device_register(indio_dev);
- if (ret)
- goto error_free_dev;
-
- dev_info(&spi_dev->dev, "%s temperature sensor registered.\n",
- indio_dev->name);
-
- return 0;
-error_free_dev:
- iio_free_device(indio_dev);
-error_ret:
- return ret;
-}
-
-static int __devexit ad7314_remove(struct spi_device *spi_dev)
-{
- struct iio_dev *indio_dev = dev_get_drvdata(&spi_dev->dev);
-
- dev_set_drvdata(&spi_dev->dev, NULL);
- iio_device_unregister(indio_dev);
-
- return 0;
-}
-
-static const struct spi_device_id ad7314_id[] = {
- { "adt7301", 0 },
- { "adt7302", 0 },
- { "ad7314", 0 },
- {}
-};
-
-static struct spi_driver ad7314_driver = {
- .driver = {
- .name = "ad7314",
- .bus = &spi_bus_type,
- .owner = THIS_MODULE,
- },
- .probe = ad7314_probe,
- .remove = __devexit_p(ad7314_remove),
- .id_table = ad7314_id,
-};
-
-static __init int ad7314_init(void)
-{
- return spi_register_driver(&ad7314_driver);
-}
-
-static __exit void ad7314_exit(void)
-{
- spi_unregister_driver(&ad7314_driver);
-}
-
-MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
-MODULE_DESCRIPTION("Analog Devices AD7314, ADT7301 and ADT7302 digital"
- " temperature sensor driver");
-MODULE_LICENSE("GPL v2");
-
-module_init(ad7314_init);
-module_exit(ad7314_exit);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* RE: [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon.
2011-09-30 10:20 [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon Jonathan Cameron
@ 2011-10-05 8:39 ` Hennerich, Michael
2011-10-05 9:40 ` Guenter Roeck
0 siblings, 1 reply; 6+ messages in thread
From: Hennerich, Michael @ 2011-10-05 8:39 UTC (permalink / raw)
To: Jonathan Cameron, linux-iio@vger.kernel.org
Cc: Device-drivers-devel@blackfin.uclinux.org,
guenter.roeck@ericsson.com
Jonathan Cameron wrote on 2011-09-30:
> Driver ported over to hwmon where it fits much better.
>
> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> ---
> Technically there is a slight loss of functionality in the hwmon
> driver (no power down mode).
>
> Otherwise, lets clear this one out.
>
> 3 more to go on my removal list ;)
> adt7310, adt7410 and adt75.
>
> If anyone is bored, those are rather more effort than this one was.
>
> Jonathan
>
> drivers/staging/iio/adc/Kconfig | 7 -
> drivers/staging/iio/adc/Makefile | 1 -
> drivers/staging/iio/adc/ad7314.c | 281 ------------------------------
> -------- 3 files changed, 0 insertions(+), 289 deletions(-) delete mode
> 100644 drivers/staging/iio/adc/ad7314.c
> diff --git a/drivers/staging/iio/adc/Kconfig
> b/drivers/staging/iio/adc/Kconfig index 070efd3..2c1b7de 100644 ---
> a/drivers/staging/iio/adc/Kconfig +++ b/drivers/staging/iio/adc/Kconfig
> @@ -34,13 +34,6 @@ config AD7298
> To compile this driver as a module, choose M here: the
> module will be called ad7298.
> -config AD7314
> - tristate "Analog Devices AD7314 temperature sensor driver"
> - depends on SPI
> - help
> - Say yes here to build support for Analog Devices AD7314
> - temperature sensors.
> -
> config AD7606
> tristate "Analog Devices AD7606 ADC driver"
> depends on GPIOLIB
> diff --git a/drivers/staging/iio/adc/Makefile
> b/drivers/staging/iio/adc/Makefile index 8adf096..93dc84b 100644 ---
> a/drivers/staging/iio/adc/Makefile +++
> b/drivers/staging/iio/adc/Makefile @@ -32,7 +32,6 @@
> obj-$(CONFIG_AD7298) +=3D ad7298.o
> obj-$(CONFIG_AD7150) +=3D ad7150.o obj-$(CONFIG_AD7152) +=3D ad7152.o
> obj-$(CONFIG_AD7291) +=3D ad7291.o -obj-$(CONFIG_AD7314) +=3D ad7314.o
> obj-$(CONFIG_AD7746) +=3D ad7746.o obj-$(CONFIG_AD7780) +=3D ad7780.o
> obj-$(CONFIG_AD7793) +=3D ad7793.o
diff --git a/drivers/staging/iio/adc/ad7314.c
b/drivers/staging/iio/adc/ad7314.c deleted file mode 100644 index
094a4ee..0000000 --- a/drivers/staging/iio/adc/ad7314.c +++ /dev/null @@
-1,281 +0,0 @@ -/* - * AD7314 digital temperature sensor driver for
AD7314, ADT7301 and ADT7302 - * - * Copyright 2010 Analog Devices Inc. -
* - * Licensed under the GPL-2 or later. - */ - -#include
<linux/device.h> -#include <linux/kernel.h> -#include <linux/slab.h>
-#include <linux/sysfs.h> -#include <linux/spi/spi.h> -#include
<linux/module.h> - -#include "../iio.h" -#include "../sysfs.h" - -/* - *
AD7314 power mode - */ -#define AD7314_PD 0x2000 - -/* - * AD=
7314
temperature masks - */ -#define AD7314_TEMP_SIGN 0x200 -#def=
ine
AD7314_TEMP_MASK 0x7FE0 -#define AD7314_TEMP_OFFSET =
5 -#define
AD7314_TEMP_FLOAT_OFFSET 2 -#define AD7314_TEMP_FLOAT_MASK =
0x3 - -/* - *
ADT7301 and ADT7302 temperature masks - */ -#define
ADT7301_TEMP_SIGN 0x2000 -#define ADT7301_TEMP_MASK =
0x2FFF -#define
ADT7301_TEMP_FLOAT_OFFSET 5 -#define ADT7301_TEMP_FLOAT_MASK =
0x1F - -/*
- * struct ad7314_chip_info - chip specifc information - */ - -struct
ad7314_chip_info { - struct spi_device *spi_dev; - s64 last_timestamp;
- u8 mode; -}; - -/* - * ad7314 register access by SPI - */ - -stati=
c
int ad7314_spi_read(struct ad7314_chip_info *chip, u16 *data) -{ - str=
uct
spi_device *spi_dev =3D chip->spi_dev; - int ret =3D 0; - u16 value; - - =
ret
=3D spi_read(spi_dev, (u8 *)&value, sizeof(value)); - if (ret < 0) {
- dev_err(&spi_dev->dev, "SPI read error\n"); - ret=
urn ret; - } -
- *data =3D be16_to_cpu((u16)value); - - return ret; -} - -static =
int
ad7314_spi_write(struct ad7314_chip_info *chip, u16 data) -{ - struct
spi_device *spi_dev =3D chip->spi_dev; - int ret =3D 0; - u16 value =3D
cpu_to_be16(data); - - ret =3D spi_write(spi_dev, (u8 *)&value,
sizeof(value)); - if (ret < 0) - dev_err(&spi_dev->dev, "SPI=
write
error\n"); - - return ret; -} - -static ssize_t ad7314_show_mode(struct
device *dev, - struct device_attribute *attr, - cha=
r *buf) -{ - struct
iio_dev *dev_info =3D dev_get_drvdata(dev); - struct ad7314_chip_info *=
chip
=3D iio_priv(dev_info); - - if (chip->mode) - return sp=
rintf(buf,
"power-save\n"); - else - return sprintf(buf, "full\n"); -} -=
-static
ssize_t ad7314_store_mode(struct device *dev, - struct devi=
ce_attribute
*attr, - const char *buf, - size_t len) -{ - =
struct iio_dev *dev_info =3D
dev_get_drvdata(dev); - struct ad7314_chip_info *chip =3D
iio_priv(dev_info); - u16 mode =3D 0; - int ret; - - if (!strcmp(buf,
"full")) - mode =3D AD7314_PD; - - ret =3D ad7314_spi_write(=
chip, mode);
- if (ret) - return -EIO; - - chip->mode =3D mode=
; - - return len; -} -
-static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, - ad7314_show=
_mode,
- ad7314_store_mode, - 0); - -static ssize_t
ad7314_show_available_modes(struct device *dev, - struct
device_attribute *attr, - char *buf) -{ - return sprintf(buf,
"full\npower-save\n"); -} - -static IIO_DEVICE_ATTR(available_modes,
S_IRUGO, ad7314_show_available_modes, NULL, 0); - -static ssize_t
ad7314_show_temperature(struct device *dev, - struct device_attri=
bute
*attr, - char *buf) -{ - struct iio_dev *dev_info =3D
dev_get_drvdata(dev); - struct ad7314_chip_info *chip =3D
iio_priv(dev_info); - u16 data; - char sign =3D ' '; - int ret; =
- - if
(chip->mode) { - ret =3D ad7314_spi_write(chip, 0); - =
if (ret) - return
-EIO; - } - - ret =3D ad7314_spi_read(chip, &data); - if (ret) =
- return
-EIO; - - if (chip->mode) - ad7314_spi_write(chip, chip=
->mode); - - if
(strcmp(dev_info->name, "ad7314")) { - data =3D (data & AD7314_TEM=
P_MASK)
>> - AD7314_TEMP_OFFSET; - if (data & AD7314_T=
EMP_SIGN) { - data =3D
(AD7314_TEMP_SIGN << 1) - data; - sign =3D '-'; - =
} - - return
sprintf(buf, "%c%d.%.2d\n", sign, - data >> AD7=
314_TEMP_FLOAT_OFFSET,
- (data & AD7314_TEMP_FLOAT_MASK) * 25); - =
} else { - data &=3D
ADT7301_TEMP_MASK; - if (data & ADT7301_TEMP_SIGN) { - =
data =3D
(ADT7301_TEMP_SIGN << 1) - data; - sign =3D '-'; - =
} - - return
sprintf(buf, "%c%d.%.5d\n", sign, - data >> ADT=
7301_TEMP_FLOAT_OFFSET,
- (data & ADT7301_TEMP_FLOAT_MASK) * 3125); -=
} -} - -static
IIO_DEVICE_ATTR(temperature, S_IRUGO, ad7314_show_temperature, NULL, 0);
- -static struct attribute *ad7314_attributes[] =3D {
- &iio_dev_attr_available_modes.dev_attr.attr,
- &iio_dev_attr_mode.dev_attr.attr,
- &iio_dev_attr_temperature.dev_attr.attr, - NULL, -}; - -static=
const
struct attribute_group ad7314_attribute_group =3D { - .attrs =3D
ad7314_attributes, -}; - -static const struct iio_info ad7314_info =3D {
- .attrs =3D &ad7314_attribute_group, - .driver_module =3D THIS_M=
ODULE, -};
-/* - * device probe and remove - */ - -static int __devinit
ad7314_probe(struct spi_device *spi_dev) -{ - struct ad7314_chip_info
*chip; - struct iio_dev *indio_dev; - int ret =3D 0; - - i=
ndio_dev =3D
iio_allocate_device(sizeof(*chip)); - if (indio_dev =3D=3D NULL) { - =
ret =3D
-ENOMEM; - goto error_ret; - } - chip =3D iio_priv(i=
ndio_dev); - /* this
is only used for device removal purposes */
- dev_set_drvdata(&spi_dev->dev, chip); - - chip->spi_dev =3D s=
pi_dev; -
- indio_dev->name =3D spi_get_device_id(spi_dev)->name;
- indio_dev->dev.parent =3D &spi_dev->dev; - indio_dev->info =
=3D
&ad7314_info; - - ret =3D iio_device_register(indio_dev); - if (ret)
- goto error_free_dev; - - dev_info(&spi_dev->dev, "%s=
temperature
sensor registered.\n", - indio_dev->name); - - ret=
urn 0;
-error_free_dev: - iio_free_device(indio_dev); -error_ret: - ret=
urn ret;
-} - -static int __devexit ad7314_remove(struct spi_device *spi_dev) -{
- struct iio_dev *indio_dev =3D dev_get_drvdata(&spi_dev->dev); -
- dev_set_drvdata(&spi_dev->dev, NULL);
- iio_device_unregister(indio_dev); - - return 0; -} - -static cons=
t
struct spi_device_id ad7314_id[] =3D { - { "adt7301", 0 }, - { "adt730=
2", 0
}, - { "ad7314", 0 }, - {} -}; - -static struct spi_driver ad7314_d=
river
=3D { - .driver =3D { - .name =3D "ad7314", - .bus =
=3D &spi_bus_type, - .owner
=3D THIS_MODULE, - }, - .probe =3D ad7314_probe, - .remove=
=3D
__devexit_p(ad7314_remove), - .id_table =3D ad7314_id, -}; - -static __in=
it
int ad7314_init(void) -{ - return spi_register_driver(&ad7314_driver);=
-}
- -static __exit void ad7314_exit(void) -{
- spi_unregister_driver(&ad7314_driver); -} - -MODULE_AUTHOR("Sonic Z=
hang
<sonic.zhang@analog.com>"); -MODULE_DESCRIPTION("Analog Devices AD7314,
ADT7301 and ADT7302 digital" - " temperature sensor driver=
");
-MODULE_LICENSE("GPL v2"); - -module_init(ad7314_init);
-module_exit(ad7314_exit);
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Mar=
garet Seif
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon.
2011-10-05 8:39 ` Hennerich, Michael
@ 2011-10-05 9:40 ` Guenter Roeck
2011-10-05 10:07 ` Jonathan Cameron
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2011-10-05 9:40 UTC (permalink / raw)
To: Hennerich, Michael
Cc: Jonathan Cameron, linux-iio@vger.kernel.org,
Device-drivers-devel@blackfin.uclinux.org
On Wed, Oct 05, 2011 at 04:39:01AM -0400, Hennerich, Michael wrote:
> Jonathan Cameron wrote on 2011-09-30:
> > Driver ported over to hwmon where it fits much better.
> >
> > Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
>
> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
>
> > ---
> > Technically there is a slight loss of functionality in the hwmon
> > driver (no power down mode).
> >
> > Otherwise, lets clear this one out.
> >
> > 3 more to go on my removal list ;)
> > adt7310, adt7410 and adt75.
> >
Just noticed this part. ADT75 is the Analog version of LM75.
Any reason not to use the standard LM75 driver instead ?
On a side note, the iio adt75 driver won't work properly if oneshot is configured.
I'll leave it to the readers to figure out why ;).
Regarding the power down mode, shouldn't this be supported using the standard
suspend/resume API with CONFIG_PM ? Or does iio have a parallel mechanism ?
Thanks,
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon.
2011-10-05 9:40 ` Guenter Roeck
@ 2011-10-05 10:07 ` Jonathan Cameron
2011-10-05 10:29 ` Guenter Roeck
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2011-10-05 10:07 UTC (permalink / raw)
To: Guenter Roeck
Cc: Hennerich, Michael, linux-iio@vger.kernel.org,
Device-drivers-devel@blackfin.uclinux.org
On 10/05/11 10:40, Guenter Roeck wrote:
> On Wed, Oct 05, 2011 at 04:39:01AM -0400, Hennerich, Michael wrote:
>> Jonathan Cameron wrote on 2011-09-30:
>>> Driver ported over to hwmon where it fits much better.
>>>
>>> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
>>
>> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
>>
>>> ---
>>> Technically there is a slight loss of functionality in the hwmon
>>> driver (no power down mode).
>>>
>>> Otherwise, lets clear this one out.
>>>
>>> 3 more to go on my removal list ;)
>>> adt7310, adt7410 and adt75.
>>>
>
> Just noticed this part. ADT75 is the Analog version of LM75.
> Any reason not to use the standard LM75 driver instead ?
Fine by me! I didn't realise that was the case. Thanks for pointing it
out.
Michael, are you happy with simply adding the id to the lm75 driver and
dropping the iio one? I can always do the actual patches if that helps.
>
> On a side note, the iio adt75 driver won't work properly if oneshot is configured.
> I'll leave it to the readers to figure out why ;).
I dread to think, these few are a mess.
>
> Regarding the power down mode, shouldn't this be supported using the standard
> suspend/resume API with CONFIG_PM ? Or does iio have a parallel mechanism ?
It's more a case of run time power management. Suspend support should indeed
be in there, but typically people want to shut these chips down if no one cares
about them, not just on suspend. Now we can apply heuristics (no one has
buffered access open, and any sysfs read is slow enough to bring the chip up
from powerdown anyway). Normally that sort of stuff is a little fiddly so we
are leaving it to individual drivers to handle. They many also want to notify
the core that regulators / buses can be shut down as well. This is particularly
true of stateless devices.
Power down attributes like in here certainly isn't part of IIO. Some of the
uglier drivers do it though. Basically we always knew these adtxx drivers
were going to leave IIO so no one has ever worked on them except to keep
them compiling.
The only stuff we explicitly have is support of individual channel power down on output
devices (often have to control what state the pin is left in when powered down).
Individual power down may make sense on some input devices (ADCs), but I haven't seen
anything that supports it yet.
Jonathan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon.
2011-10-05 10:07 ` Jonathan Cameron
@ 2011-10-05 10:29 ` Guenter Roeck
2011-10-05 11:50 ` Hennerich, Michael
0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2011-10-05 10:29 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hennerich, Michael, linux-iio@vger.kernel.org,
Device-drivers-devel@blackfin.uclinux.org
On Wed, Oct 05, 2011 at 06:07:16AM -0400, Jonathan Cameron wrote:
> On 10/05/11 10:40, Guenter Roeck wrote:
> > On Wed, Oct 05, 2011 at 04:39:01AM -0400, Hennerich, Michael wrote:
> >> Jonathan Cameron wrote on 2011-09-30:
> >>> Driver ported over to hwmon where it fits much better.
> >>>
> >>> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
> >>
> >> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> >>
> >>> ---
> >>> Technically there is a slight loss of functionality in the hwmon
> >>> driver (no power down mode).
> >>>
> >>> Otherwise, lets clear this one out.
> >>>
> >>> 3 more to go on my removal list ;)
> >>> adt7310, adt7410 and adt75.
> >>>
> >
> > Just noticed this part. ADT75 is the Analog version of LM75.
> > Any reason not to use the standard LM75 driver instead ?
> Fine by me! I didn't realise that was the case. Thanks for pointing it
> out.
>
> Michael, are you happy with simply adding the id to the lm75 driver and
> dropping the iio one? I can always do the actual patches if that helps.
LM75 / ADT75 does not have an ID register, unfortunately. The code uses some kind
of heuristics to detect it. Someone will have to test if the LM75 driver works;
if not, we'll have to come up with a mechanism to detect ADT75. I requested samples,
but it looks like I asked for too many lately and could only get ADT75A, not ADT75B.
I hope there are no register differences between the variants.
> >
> > On a side note, the iio adt75 driver won't work properly if oneshot is configured.
> > I'll leave it to the readers to figure out why ;).
> I dread to think, these few are a mess.
>
> >
> > Regarding the power down mode, shouldn't this be supported using the standard
> > suspend/resume API with CONFIG_PM ? Or does iio have a parallel mechanism ?
> It's more a case of run time power management. Suspend support should indeed
> be in there, but typically people want to shut these chips down if no one cares
> about them, not just on suspend. Now we can apply heuristics (no one has
> buffered access open, and any sysfs read is slow enough to bring the chip up
> from powerdown anyway). Normally that sort of stuff is a little fiddly so we
Hmmm ... not true for ADT75, really. Per datasheet, the chip takes 1.7ms to come out
of shutdown and then requires another 60ms for a conversion (hint, hint, for the oneshot
problem suggested above). sysfs may be slow, but it is not _that_ slow.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon.
2011-10-05 10:29 ` Guenter Roeck
@ 2011-10-05 11:50 ` Hennerich, Michael
0 siblings, 0 replies; 6+ messages in thread
From: Hennerich, Michael @ 2011-10-05 11:50 UTC (permalink / raw)
To: Guenter Roeck, Jonathan Cameron
Cc: linux-iio@vger.kernel.org,
Device-drivers-devel@blackfin.uclinux.org
Guenter Roeck wrote on 2011-10-05:
> On Wed, Oct 05, 2011 at 06:07:16AM -0400, Jonathan Cameron wrote:
>> On 10/05/11 10:40, Guenter Roeck wrote:
>>> On Wed, Oct 05, 2011 at 04:39:01AM -0400, Hennerich, Michael wrote:
>>>> Jonathan Cameron wrote on 2011-09-30:
>>>>> Driver ported over to hwmon where it fits much better.
>>>>>
>>>>> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
>>>>
>>>> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
>>>>
>>>>> ---
>>>>> Technically there is a slight loss of functionality in the hwmon
>>>>> driver (no power down mode).
>>>>>
>>>>> Otherwise, lets clear this one out.
>>>>>
>>>>> 3 more to go on my removal list ;)
>>>>> adt7310, adt7410 and adt75.
>>>>>
>>>
>>> Just noticed this part. ADT75 is the Analog version of LM75.
>>> Any reason not to use the standard LM75 driver instead ?
>> Fine by me! I didn't realise that was the case. Thanks for pointing
>> it out.
>>
>> Michael, are you happy with simply adding the id to the lm75 driver and
>> dropping the iio one? I can always do the actual patches if that
> helps.
Adding the id is not enough.
I'm fine with dropping the IIO ADT75 in case the LM75 works with the ADT75.
> LM75 / ADT75 does not have an ID register, unfortunately. The code uses
> some kind
> of heuristics to detect it. Someone will have to test if the LM75
> driver works;
There is a small register difference (REG 4).
> if not, we'll have to come up with a mechanism to detect ADT75. I
> requested samples,
> but it looks like I asked for too many lately and could only get
> ADT75A, not ADT75B.
> I hope there are no register differences between the variants.
>
>>>
>>> On a side note, the iio adt75 driver won't work properly if oneshot is
>>> configured. I'll leave it to the readers to figure out why ;).
>> I dread to think, these few are a mess.
>>
>>>
>>> Regarding the power down mode, shouldn't this be supported using the
>>> standard suspend/resume API with CONFIG_PM ? Or does iio have a
>>> parallel
> mechanism ?
>> It's more a case of run time power management. Suspend support should
>> indeed be in there, but typically people want to shut these chips down
>> if no one cares about them, not just on suspend. Now we can apply
>> heuristics (no one has buffered access open, and any sysfs read is slow
>> enough to bring the chip up from powerdown anyway). Normally that sort
>> of stuff is a little
> fiddly so we
>
> Hmmm ... not true for ADT75, really. Per datasheet, the chip takes
> 1.7ms to come out
> of shutdown and then requires another 60ms for a conversion (hint,
> hint, for the oneshot
> problem suggested above). sysfs may be slow, but it is not _that_ slow.
>
> Thanks,
> Guenter
Greetings,
Michael
--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Mar=
garet Seif
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-05 11:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30 10:20 [PATCH] staging:iio:adc:ad7314 removal. Supported via hwmon Jonathan Cameron
2011-10-05 8:39 ` Hennerich, Michael
2011-10-05 9:40 ` Guenter Roeck
2011-10-05 10:07 ` Jonathan Cameron
2011-10-05 10:29 ` Guenter Roeck
2011-10-05 11:50 ` Hennerich, Michael
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.