All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@linutronix.de>
To: Tobias Himmer <tobias@himmer-online.de>
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
	marc.pignat@hevs.ch
Subject: Re: [lm-sensors] [RFC,PATCH v1] hwmon: ADC124S501 generic driver
Date: Thu, 24 Jul 2008 15:25:56 +0000	[thread overview]
Message-ID: <20080724152556.GD2254@local> (raw)
In-Reply-To: <200807241151.50915.tobias@himmer-online.de>

On Thu, Jul 24, 2008 at 11:51:50AM +0200, Tobias Himmer wrote:
> Hi Marc,
> 
> I just wrote a similar driver for the ADC088S052.

Bad luck ;-)

> Yesterday I noticed your patch and successfully tested a slightly
> modified version of it that supports 8 channels.
> The patch below goes on top of yours.

Nice, both patches combined in mainline would be nice. Works for me.

Thanks,
Hans

> 
> Bye
> 
> Tobias
> 
> Signed-off-by: Tobias Himmer <tobias@himmer-online.de>

Acked-by: Hans J. Koch <hjk@linutronix.de>

> ---
> 
> Index: linux-2.6.26-rc/drivers/hwmon/adcxx.c
> =================================> --- linux-2.6.26-rc.orig/drivers/hwmon/adcxx.c
> +++ linux-2.6.26-rc/drivers/hwmon/adcxx.c
> @@ -5,13 +5,15 @@
>   *
>   * Copyright (c) 2008 Marc Pignat <marc.pignat@hevs.ch>
>   *
> + * 8 channel support added by Tobias Himmer <tobias@himmer-online.de>
> + *
>   * The adcxx4s communicates with a host processor via an SPI/Microwire Bus
>   * interface. This driver supports the whole family of devices with name
>   * ADC<bb><c>S<sss>, where
>   * * bb is the resolution in number of bits (8, 10, 12)
> - * * c is the number of channels (1, 2, 4)
> - * * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS
> - *   and 101 for 1 MSPS)
> + * * c is the number of channels (1, 2, 4, 8)
> + * * sss is the maximum conversion speed (021 for 200 kSPS, 051 / 052 for
> + *   500 kSPS and 101 for 1 MSPS)
>   *
>   * Complete datasheets are available at National's website here:
>   * http://www.national.com/ds/DC/ADC<bb><c>S<sss>.pdf
> @@ -155,6 +157,10 @@ static struct sensor_device_attribute ad
>  	SENSOR_ATTR(in1_input, S_IRUGO, adcxx_read, NULL, 1),
>  	SENSOR_ATTR(in2_input, S_IRUGO, adcxx_read, NULL, 2),
>  	SENSOR_ATTR(in3_input, S_IRUGO, adcxx_read, NULL, 3),
> +	SENSOR_ATTR(in4_input, S_IRUGO, adcxx_read, NULL, 4),
> +	SENSOR_ATTR(in5_input, S_IRUGO, adcxx_read, NULL, 5),
> +	SENSOR_ATTR(in6_input, S_IRUGO, adcxx_read, NULL, 6),
> +	SENSOR_ATTR(in7_input, S_IRUGO, adcxx_read, NULL, 7),
> };
>  
>  /*----------------------------------------------------------------------*/
> @@ -218,6 +224,11 @@ static int __devinit adcxx4s_probe(struc
>  	return adcxx_probe(spi, 4);
> }
>  
> +static int __devinit adcxx8s_probe(struct spi_device *spi)
> +{
> +	return adcxx_probe(spi, 8);
> +}
> +
>  static int __devexit adcxx_remove(struct spi_device *spi)
> {
>  	struct adcxx *adc = dev_get_drvdata(&spi->dev);
> @@ -259,6 +270,15 @@ static struct spi_driver adcxx4s_driver 
>  	.remove	= __devexit_p(adcxx_remove),
> };
>  
> +static struct spi_driver adcxx8s_driver = {
> +	.driver = {
> +		.name	= "adcxx8s",
> +		.owner	= THIS_MODULE,
> +	},
> +	.probe	= adcxx8s_probe,
> +	.remove	= __devexit_p(adcxx_remove),
> +};
> +
>  static int __init init_adcxx(void)
> {
>  	int status;
> @@ -270,7 +290,11 @@ static int __init init_adcxx(void)
>  	if (status)
>  		return status;
>  
> -	return spi_register_driver(&adcxx4s_driver);
> +	status = spi_register_driver(&adcxx4s_driver);
> +	if (status)
> +		return status;
> +
> +	return spi_register_driver(&adcxx8s_driver);
> }
>  
>  static void __exit exit_adcxx(void)
> @@ -278,6 +302,7 @@ static void __exit exit_adcxx(void)
>  	spi_unregister_driver(&adcxx1s_driver);
>  	spi_unregister_driver(&adcxx2s_driver);
>  	spi_unregister_driver(&adcxx4s_driver);
> +	spi_unregister_driver(&adcxx8s_driver);
> }
>  
>  module_init(init_adcxx);
> @@ -290,3 +315,4 @@ MODULE_LICENSE("GPL");
>  MODULE_ALIAS("adcxx1s");
>  MODULE_ALIAS("adcxx2s");
>  MODULE_ALIAS("adcxx4s");
> +MODULE_ALIAS("adcxx8s");
> Index: linux-2.6.26-rc/drivers/hwmon/Kconfig
> =================================> --- linux-2.6.26-rc.orig/drivers/hwmon/Kconfig
> +++ linux-2.6.26-rc/drivers/hwmon/Kconfig
> @@ -397,9 +397,9 @@ config SENSORS_ADCXX
>  	  If you say yes here you get support for the National Semiconductor
>  	  ADC<bb><c>S<sss> chip family, where
>  	  * bb  is the resolution in number of bits (8, 10, 12)
> -	  * c   is the number of channels (1, 2, 4)
> -	  * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500
> -	    kSPS and 101 for 1 MSPS)
> +	  * c   is the number of channels (1, 2, 4, 8)
> +	  * sss is the maximum conversion speed (021 for 200 kSPS, 051 / 052 for
> +	    500 kSPS and 101 for 1 MSPS)
>  
>  	  Examples : ADC081S101, ADC124S501, ...
>  
> --
> 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/

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

WARNING: multiple messages have this Message-ID (diff)
From: "Hans J. Koch" <hjk@linutronix.de>
To: Tobias Himmer <tobias@himmer-online.de>
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
	marc.pignat@hevs.ch
Subject: Re: [RFC,PATCH v1] hwmon: ADC124S501 generic driver
Date: Thu, 24 Jul 2008 17:25:56 +0200	[thread overview]
Message-ID: <20080724152556.GD2254@local> (raw)
In-Reply-To: <200807241151.50915.tobias@himmer-online.de>

On Thu, Jul 24, 2008 at 11:51:50AM +0200, Tobias Himmer wrote:
> Hi Marc,
> 
> I just wrote a similar driver for the ADC088S052.

Bad luck ;-)

> Yesterday I noticed your patch and successfully tested a slightly
> modified version of it that supports 8 channels.
> The patch below goes on top of yours.

Nice, both patches combined in mainline would be nice. Works for me.

Thanks,
Hans

> 
> Bye
> 
> Tobias
> 
> Signed-off-by: Tobias Himmer <tobias@himmer-online.de>

Acked-by: Hans J. Koch <hjk@linutronix.de>

> ---
> 
> Index: linux-2.6.26-rc/drivers/hwmon/adcxx.c
> ===================================================================
> --- linux-2.6.26-rc.orig/drivers/hwmon/adcxx.c
> +++ linux-2.6.26-rc/drivers/hwmon/adcxx.c
> @@ -5,13 +5,15 @@
>   *
>   * Copyright (c) 2008 Marc Pignat <marc.pignat@hevs.ch>
>   *
> + * 8 channel support added by Tobias Himmer <tobias@himmer-online.de>
> + *
>   * The adcxx4s communicates with a host processor via an SPI/Microwire Bus
>   * interface. This driver supports the whole family of devices with name
>   * ADC<bb><c>S<sss>, where
>   * * bb is the resolution in number of bits (8, 10, 12)
> - * * c is the number of channels (1, 2, 4)
> - * * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS
> - *   and 101 for 1 MSPS)
> + * * c is the number of channels (1, 2, 4, 8)
> + * * sss is the maximum conversion speed (021 for 200 kSPS, 051 / 052 for
> + *   500 kSPS and 101 for 1 MSPS)
>   *
>   * Complete datasheets are available at National's website here:
>   * http://www.national.com/ds/DC/ADC<bb><c>S<sss>.pdf
> @@ -155,6 +157,10 @@ static struct sensor_device_attribute ad
>  	SENSOR_ATTR(in1_input, S_IRUGO, adcxx_read, NULL, 1),
>  	SENSOR_ATTR(in2_input, S_IRUGO, adcxx_read, NULL, 2),
>  	SENSOR_ATTR(in3_input, S_IRUGO, adcxx_read, NULL, 3),
> +	SENSOR_ATTR(in4_input, S_IRUGO, adcxx_read, NULL, 4),
> +	SENSOR_ATTR(in5_input, S_IRUGO, adcxx_read, NULL, 5),
> +	SENSOR_ATTR(in6_input, S_IRUGO, adcxx_read, NULL, 6),
> +	SENSOR_ATTR(in7_input, S_IRUGO, adcxx_read, NULL, 7),
> };
>  
>  /*----------------------------------------------------------------------*/
> @@ -218,6 +224,11 @@ static int __devinit adcxx4s_probe(struc
>  	return adcxx_probe(spi, 4);
> }
>  
> +static int __devinit adcxx8s_probe(struct spi_device *spi)
> +{
> +	return adcxx_probe(spi, 8);
> +}
> +
>  static int __devexit adcxx_remove(struct spi_device *spi)
> {
>  	struct adcxx *adc = dev_get_drvdata(&spi->dev);
> @@ -259,6 +270,15 @@ static struct spi_driver adcxx4s_driver 
>  	.remove	= __devexit_p(adcxx_remove),
> };
>  
> +static struct spi_driver adcxx8s_driver = {
> +	.driver = {
> +		.name	= "adcxx8s",
> +		.owner	= THIS_MODULE,
> +	},
> +	.probe	= adcxx8s_probe,
> +	.remove	= __devexit_p(adcxx_remove),
> +};
> +
>  static int __init init_adcxx(void)
> {
>  	int status;
> @@ -270,7 +290,11 @@ static int __init init_adcxx(void)
>  	if (status)
>  		return status;
>  
> -	return spi_register_driver(&adcxx4s_driver);
> +	status = spi_register_driver(&adcxx4s_driver);
> +	if (status)
> +		return status;
> +
> +	return spi_register_driver(&adcxx8s_driver);
> }
>  
>  static void __exit exit_adcxx(void)
> @@ -278,6 +302,7 @@ static void __exit exit_adcxx(void)
>  	spi_unregister_driver(&adcxx1s_driver);
>  	spi_unregister_driver(&adcxx2s_driver);
>  	spi_unregister_driver(&adcxx4s_driver);
> +	spi_unregister_driver(&adcxx8s_driver);
> }
>  
>  module_init(init_adcxx);
> @@ -290,3 +315,4 @@ MODULE_LICENSE("GPL");
>  MODULE_ALIAS("adcxx1s");
>  MODULE_ALIAS("adcxx2s");
>  MODULE_ALIAS("adcxx4s");
> +MODULE_ALIAS("adcxx8s");
> Index: linux-2.6.26-rc/drivers/hwmon/Kconfig
> ===================================================================
> --- linux-2.6.26-rc.orig/drivers/hwmon/Kconfig
> +++ linux-2.6.26-rc/drivers/hwmon/Kconfig
> @@ -397,9 +397,9 @@ config SENSORS_ADCXX
>  	  If you say yes here you get support for the National Semiconductor
>  	  ADC<bb><c>S<sss> chip family, where
>  	  * bb  is the resolution in number of bits (8, 10, 12)
> -	  * c   is the number of channels (1, 2, 4)
> -	  * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500
> -	    kSPS and 101 for 1 MSPS)
> +	  * c   is the number of channels (1, 2, 4, 8)
> +	  * sss is the maximum conversion speed (021 for 200 kSPS, 051 / 052 for
> +	    500 kSPS and 101 for 1 MSPS)
>  
>  	  Examples : ADC081S101, ADC124S501, ...
>  
> --
> 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/

  reply	other threads:[~2008-07-24 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 11:07 [lm-sensors] [RFC,PATCH v1] hwmon: ADC124S501 generic driver Marc Pignat
2008-07-23 11:07 ` Marc Pignat
2008-07-24  9:51 ` [lm-sensors] " Tobias Himmer
2008-07-24  9:51   ` Tobias Himmer
2008-07-24 15:25   ` Hans J. Koch [this message]
2008-07-24 15:25     ` Hans J. Koch
2008-07-29  4:35 ` [lm-sensors] " Andrew Morton
2008-07-29  4:35   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080724152556.GD2254@local \
    --to=hjk@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=marc.pignat@hevs.ch \
    --cc=tobias@himmer-online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.