lkml.org 
[lkml]   [2011]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hwmon: Driver for as1531, Austria-Microsystem Analog to Digital Converter.
On Mon, 16 May 2011 15:39:14 +0200 fabien.marteau@armadeus.com wrote:

> From: Fabien Marteau <fabien.marteau@armadeus.com>
>
>
> Signed-off-by: Fabien Marteau <fabien.marteau@armadeus.com>
> ---
> drivers/hwmon/Kconfig | 10 ++
> drivers/hwmon/Makefile | 1 +
> drivers/hwmon/as1531.c | 297 ++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 308 insertions(+), 0 deletions(-)
> create mode 100644 drivers/hwmon/as1531.c
>
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index 50e40db..d2ba655 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -104,6 +104,16 @@ config SENSORS_ADCXX
> This driver can also be built as a module. If so, the module
> will be called adcxx.
>
> +config SENSORS_AS1531
> + tristate "Austria Microsystems AS1531 Analog to Digital Converter"
> + depends on SPI_MASTER
> + help
> + If you say yes here you get support for Austria Microsystems AS1531.
> + AS1531 is a 12 bits Analog to digitals converter with 8 channels

is a 12? bits

what is the character after the "12", please?

Analog to digital converter

> + provided by Austria-Microsystems company.
> + This driver can also be built as a module. If so, the module
> + will be called as1531.
> +
> config SENSORS_ADM1021
> tristate "Analog Devices ADM1021 and compatibles"
> depends on I2C


> +/*----------------------------------------------------------------------*/
> +
> +static int __devinit as1531_probe(struct spi_device *spi)
> +{
> + struct as1531 *adc;
> + int status;
> + int i;
> +
> + adc = kzalloc(sizeof(struct as1531), GFP_KERNEL);
> + if (adc == NULL)
> + return -ENOMEM;
> +
> + mutex_init(&adc->lock);
> + mutex_lock(&adc->lock);
> +
> + dev_set_drvdata(&spi->dev, adc);
> +
> + for (i = 0; i < 11; i++) {

s/11/ARRAY_SIZE(as1531_input)/

> + status = device_create_file(&spi->dev,
> + &as1531_input[i].dev_attr);
> + if (status < 0) {
> + dev_err(&spi->dev, "device_create_file failed.\n");
> + goto out_err;
> + }
> + }



---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-05-16 17:05    [W:0.078 / U:96.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site