hwmon: (nct6775) Fix writing pwmX_mode
authorGuenter Roeck <linux@roeck-us.net>
Tue, 27 Mar 2018 02:50:31 +0000 (19:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:28 +0000 (07:52 +0200)
commit68a38cedff764feb87353f90d1ad9b70afdd635e
treec5ded8b2af2b8f3bd510b20cfb789e5be8229347
parentdbce9e41161cef5365ebd17f8597ea7e986977c1
hwmon: (nct6775) Fix writing pwmX_mode

[ Upstream commit 415eb2a1aaa4881cf85bd86c683356fdd8094a23 ]

pwmX_mode is defined in the ABI as 0=DC mode, 1=pwm mode. The chip
register bit is set to 1 for DC mode. This got mixed up, and writing
1 into pwmX_mode resulted in DC mode enabled. Fix it up by using
the ABI definition throughout the driver for consistency.

Fixes: 77eb5b3703d99 ("hwmon: (nct6775) Add support for pwm, pwm_mode, ... ")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/nct6775.c