Guenter Roeck | 2 Mar 2011 06:32
Picon
Favicon

[PATCH] hwmon: (pmbus) More stringent checking of VOUT_MODE register

Some PMBus chips do not support the VOUT_MODE register. To make matters worse,
such chips may not return an error when reading the register either, but instead
return 0xff.

Check if the register exists using pmbus_check_byte_register() before reading
its value. In addition, validate the returned value and ignore it if it is 0xff
(which is invalid).

Reported-by: Greg Schnorr <gschnorr <at> cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck <at> ericsson.com>
---
 drivers/hwmon/pmbus_core.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/pmbus_core.c b/drivers/hwmon/pmbus_core.c
index 0edab1c..b7c64ba 100644
--- a/drivers/hwmon/pmbus_core.c
+++ b/drivers/hwmon/pmbus_core.c
 <at>  <at>  -1426,10 +1426,11  <at>  <at>  static void pmbus_find_attributes(struct i2c_client *client,
 static int pmbus_identify_common(struct i2c_client *client,
 				 struct pmbus_data *data)
 {
-	int vout_mode, exponent;
+	int vout_mode = -1, exponent;

-	vout_mode = pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE);
-	if (vout_mode >= 0) {
+	if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE))
+		vout_mode = pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE);
+	if (vout_mode >= 0 && vout_mode != 0xff) {
(Continue reading)

Jean Delvare | 2 Mar 2011 18:57
Gravatar

Re: [PATCH v4] hwmon: Add support for Texas Instruments ADS1015

Hi Dirk,

On Fri, 25 Feb 2011 14:18:17 +0100, Dirk Eibach wrote:
> Signed-off-by: Dirk Eibach <eibach <at> gdsys.de>
> ---
> Changes since v1:
> - fixed/extended Documentation
> - removed unused register definitions
> - hardcoded PGA fullscale table size
> - made sure patch applies against v2.6.38-rc4
> - reordered functions to avoid forward declaration
> - results from i2c_smbus_read_word_data() are handled correctly
> - moved locking into ads1015_read_value()
> - removed unnecessray clearing of bit
> - proper error handling in ads1015_read_value()
> - use DIV_ROUND_CLOSEST for scaling result
> - removed detect()
> 
> Changes since v2:
> - removed *all* leftovers from detect()
> - fixed return with mutex held
> - made sysfs representation configurable
>   (hope this will be the reference implementation for generations to come ;)
> 
> Changes since v3:
> - included linux/of.h
> - remove linux/types.h from header file
> - sysfs is now configured with a bitmask
> - assume big-endian of-properties

(Continue reading)

Guenter Roeck | 3 Mar 2011 00:23
Picon
Favicon

[PATCH] hwmon: Add tachometer pulses per fan revolution to sysfs ABI

Some fan control chips support a configuration register to set the number of
tachometer pulses per fan revolution. Add an ABI attribute to support this
configuration register.

Signed-off-by: Guenter Roeck <guenter.roeck <at> ericsson.com>
---
 Documentation/hwmon/sysfs-interface |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index c6559f1..134c6a4 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
 <at>  <at>  -187,6 +187,12  <at>  <at>  fan[1-*]_div	Fan divisor.
 		Note that this is actually an internal clock divisor, which
 		affects the measurable speed range, not the read value.

+fan[1-*]_pulses	Number of tachometer pulses per fan revolution.
+		Integer value, typically between 1 and 4.
+		RW
+		Should only be created if the chip has a register to configure
+		the value.
+
 fan[1-*]_target
 		Desired fan speed
 		Unit: revolution/min (RPM)
--

-- 
1.7.3.1

--
(Continue reading)

Eibach, Dirk | 3 Mar 2011 08:49
Picon
Favicon

RE: (WARNING!!! PGP with incorrect signature) Re: [PATCH v4] hwmon: Add support for Texas Instruments ADS1015


> Still, there is a new property defined which _always_ needs
> 
> a) CCing devicetree-discuss (get_maintainer helps here)
> b) Documentation in Documentation/devicetree/bindings
> 
> because it needs to be a lot more stable than platform_data.

Jean, should I supply a v5 with Documentation or should I supply a
separate patch?

> (I already lost the original mail, so I sadly can't forward it)

I have forwarded it to devicetree-discuss.

> Regards,
> 
>    Wolfram

Cheers
Dirk

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jean Delvare | 3 Mar 2011 08:56
Gravatar

Re: [PATCH v4] hwmon: Add support for Texas Instruments ADS1015

On Thu, 3 Mar 2011 08:49:13 +0100, Eibach, Dirk wrote:
>  
> 
> > Still, there is a new property defined which _always_ needs
> > 
> > a) CCing devicetree-discuss (get_maintainer helps here)
> > b) Documentation in Documentation/devicetree/bindings
> > 
> > because it needs to be a lot more stable than platform_data.
> 
> Jean, should I supply a v5 with Documentation or should I supply a
> separate patch?

Separate patch. I'm not even the one who will review and apply it.

> > (I already lost the original mail, so I sadly can't forward it)
> 
> I have forwarded it to devicetree-discuss.

This is where the review will happen, and where hopefully someone will
pick up the patch.

--

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Alexandre Courbot | 3 Mar 2011 09:57
Picon
Gravatar

[PATCH] Documentation/power/states.txt: fix repetition

Remove repetition of "called swsusp".

Signed-off-by: Alexandre Courbot <gnurou <at> gmail.com>
---
 Documentation/power/states.txt |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/power/states.txt b/Documentation/power/states.txt
index 34800cc..4416b28 100644
--- a/Documentation/power/states.txt
+++ b/Documentation/power/states.txt
 <at>  <at>  -62,12 +62,12  <at>  <at>  setup via another operating system for it to use. Despite the
 inconvenience, this method requires minimal work by the kernel, since
 the firmware will also handle restoring memory contents on resume. 

-For suspend-to-disk, a mechanism called swsusp called 'swsusp' (Swap
-Suspend) is used to write memory contents to free swap space.
-swsusp has some restrictive requirements, but should work in most
-cases. Some, albeit outdated, documentation can be found in
-Documentation/power/swsusp.txt. Alternatively, userspace can do most
-of the actual suspend to disk work, see userland-swsusp.txt.
+For suspend-to-disk, a mechanism called 'swsusp' (Swap Suspend) is used
+to write memory contents to free swap space. swsusp has some restrictive
+requirements, but should work in most cases. Some, albeit outdated,
+documentation can be found in Documentation/power/swsusp.txt.
+Alternatively, userspace can do most of the actual suspend to disk work,
+see userland-swsusp.txt.

 Once memory state is written to disk, the system may either enter a
 low-power state (like ACPI S4), or it may simply power down. Powering
(Continue reading)

Dirk Eibach | 3 Mar 2011 10:16
Picon
Favicon

[PATCH] hwmon: (ads1015) Add devicetree documentation

Signed-off-by: Dirk Eibach <eibach <at> gdsys.de>
---
 Documentation/devicetree/bindings/i2c/ads1015.txt |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/ads1015.txt

diff --git a/Documentation/devicetree/bindings/i2c/ads1015.txt b/Documentation/devicetree/bindings/i2c/ads1015.txt
new file mode 100644
index 0000000..3a7d67a
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/ads1015.txt
 <at>  <at>  -0,0 +1,15  <at>  <at> 
+ADS1015 (I2C)
+
+Optional properties:
+
+ - exported-channels : exported_channels is a bitmask that specifies which
+		       inputs should be exported to sysfs.
+
+Example:
+ads1015 <at> 49 {
+	compatible = "ti,ads1015";
+	reg = <0x49>;
+	exported-channels = <0x14>;
+};
+
+In this example only in2_input and in4_input would be created.
--

-- 
1.5.6.5

(Continue reading)

Rafael J. Wysocki | 3 Mar 2011 10:37
Picon
Gravatar

Re: [PATCH] Documentation/power/states.txt: fix repetition

On Thursday, March 03, 2011, Alexandre Courbot wrote:
> Remove repetition of "called swsusp".
> 
> Signed-off-by: Alexandre Courbot <gnurou <at> gmail.com>

This patch has already been applied to suspend-2.6/linux-next.
Is this a new version?

Rafael

> ---
>  Documentation/power/states.txt |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/power/states.txt b/Documentation/power/states.txt
> index 34800cc..4416b28 100644
> --- a/Documentation/power/states.txt
> +++ b/Documentation/power/states.txt
>  <at>  <at>  -62,12 +62,12  <at>  <at>  setup via another operating system for it to use. Despite the
>  inconvenience, this method requires minimal work by the kernel, since
>  the firmware will also handle restoring memory contents on resume. 
>  
> -For suspend-to-disk, a mechanism called swsusp called 'swsusp' (Swap
> -Suspend) is used to write memory contents to free swap space.
> -swsusp has some restrictive requirements, but should work in most
> -cases. Some, albeit outdated, documentation can be found in
> -Documentation/power/swsusp.txt. Alternatively, userspace can do most
> -of the actual suspend to disk work, see userland-swsusp.txt.
> +For suspend-to-disk, a mechanism called 'swsusp' (Swap Suspend) is used
> +to write memory contents to free swap space. swsusp has some restrictive
(Continue reading)

Alexandre Courbot | 3 Mar 2011 10:42
Picon
Gravatar

Re: [PATCH] Documentation/power/states.txt: fix repetition

> This patch has already been applied to suspend-2.6/linux-next.
> Is this a new version?

No - I initially sent it to linux-doc only, so I wasn't sure someone
included it. I should have checked better, my apologies for the
inconvenience.

Alex.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane