* [PATCH] hwmon (pmbus): cffps: Add PMBUS_SKIP_STATUS_CHECK
@ 2018-01-08 21:10 Eddie James
0 siblings, 0 replies; 2+ messages in thread
From: Eddie James @ 2018-01-08 21:10 UTC (permalink / raw)
To: linux-hwmon; +Cc: linux, linux-kernel, joel, eajames
This power supply device regularly fails to read VOUT_MODE due to the
CML bit going high. This results in an incorrect exponent used for the
voltage data, and therefore the power supply reports incorrect voltage.
Work around this by setting the pmbus flag to skip the CML check.
Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
---
drivers/hwmon/pmbus/ibm-cffps.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
index de254747..2d6f4f4 100644
--- a/drivers/hwmon/pmbus/ibm-cffps.c
+++ b/drivers/hwmon/pmbus/ibm-cffps.c
@@ -15,6 +15,7 @@
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/mutex.h>
+#include <linux/pmbus.h>
#include "pmbus.h"
@@ -268,6 +269,10 @@ static int ibm_cffps_read_word_data(struct i2c_client *client, int page,
.read_word_data = ibm_cffps_read_word_data,
};
+static struct pmbus_platform_data ibm_cffps_pdata = {
+ .flags = PMBUS_SKIP_STATUS_CHECK,
+};
+
static int ibm_cffps_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -276,6 +281,7 @@ static int ibm_cffps_probe(struct i2c_client *client,
struct dentry *ibm_cffps_dir;
struct ibm_cffps *psu;
+ client->dev.platform_data = &ibm_cffps_pdata;
rc = pmbus_do_probe(client, id, &ibm_cffps_info);
if (rc)
return rc;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon (pmbus): cffps: Add PMBUS_SKIP_STATUS_CHECK
@ 2018-01-08 21:30 Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-01-08 21:30 UTC (permalink / raw)
To: Eddie James; +Cc: linux-hwmon, linux-kernel, joel
On Mon, Jan 08, 2018 at 03:10:09PM -0600, Eddie James wrote:
> This power supply device regularly fails to read VOUT_MODE due to the
> CML bit going high. This results in an incorrect exponent used for the
> voltage data, and therefore the power supply reports incorrect voltage.
> Work around this by setting the pmbus flag to skip the CML check.
>
> Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/pmbus/ibm-cffps.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
> index de254747..2d6f4f4 100644
> --- a/drivers/hwmon/pmbus/ibm-cffps.c
> +++ b/drivers/hwmon/pmbus/ibm-cffps.c
> @@ -15,6 +15,7 @@
> #include <linux/jiffies.h>
> #include <linux/module.h>
> #include <linux/mutex.h>
> +#include <linux/pmbus.h>
>
> #include "pmbus.h"
>
> @@ -268,6 +269,10 @@ static int ibm_cffps_read_word_data(struct i2c_client *client, int page,
> .read_word_data = ibm_cffps_read_word_data,
> };
>
> +static struct pmbus_platform_data ibm_cffps_pdata = {
> + .flags = PMBUS_SKIP_STATUS_CHECK,
> +};
> +
> static int ibm_cffps_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> @@ -276,6 +281,7 @@ static int ibm_cffps_probe(struct i2c_client *client,
> struct dentry *ibm_cffps_dir;
> struct ibm_cffps *psu;
>
> + client->dev.platform_data = &ibm_cffps_pdata;
> rc = pmbus_do_probe(client, id, &ibm_cffps_info);
> if (rc)
> return rc;
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-08 21:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-08 21:10 [PATCH] hwmon (pmbus): cffps: Add PMBUS_SKIP_STATUS_CHECK Eddie James
-- strict thread matches above, loose matches on Subject: below --
2018-01-08 21:30 Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox