Re: [RFC 4/8] gpio: altera-a10sr: Add A10 System Resource Chip GPIO support.

2016-04-01 Thread Linus Walleij
e lines are hardwired as output - If that is not the case, verify that all lines are really open drain, they should be if all are both input and output at the same time. > + ret = gpiochip_add(>gp); > + if (ret < 0) { > + dev_err(>dev, "Could not register gpiochip, %d\n

Re: [PATCH v4 2/6] Add Advantech iManager GPIO driver

2016-11-05 Thread Linus Walleij
t;lock); > + > + return ret; > +} Can the read function return an error code? In that case it should be checked everywhere. Also be sure to clamp ret like this: return !!ret; Apart from this it looks good. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 05/10] gpio: i2cs: Juniper I2CS to GPIO pin mapping driver

2016-10-21 Thread Linus Walleij
iper kernel] > Signed-off-by: Pantelis Antoniou <pantelis.anton...@konsulko.com> This driver again has the same review comments as the two first ones, GPIOLIB_IRQCHIP etc. Revise accordingly and repost and I will look at it again. (Interestingly this one uses BIT() properly.) Yours, Linus Walleij

[PATCH 4/7] hwmon: ab8500: convert to IIO ADC

2017-01-10 Thread Linus Walleij
This switches the AB8500 hardware monitor driver to using the standard IIO ADC channel lookup and conversion routines. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/hwmon/ab8500.c | 65 +++--- 1 file changed, 41 insertions(

[PATCH 1/7] power: supply: ab8500_btemp: convert to IIO ADC

2017-01-10 Thread Linus Walleij
This switches the AB8500 battery temperature driver to using the standard IIO ADC channel lookup and conversion routines. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/power/supply/ab8500_btemp.c | 41 ++--- 1 file changed, 29 inse

[PATCH] hwmon/sht15: Root out platform data

2017-09-08 Thread Linus Walleij
: Davide Hug <d...@videhug.ch> Cc: Jonathan Cameron <ji...@cam.ac.uk> Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- ARM SoC folks: please ACK this so the HWMON maintainer can merge it when it is in reasonable shape. Davide: can you test this patch with your setup? Jo

Re: hwmon/sht15: gpio irq problem

2017-09-08 Thread Linus Walleij
criptors first though :/ Also: which GPIO controller is this used with, so I can check how/if it supports open drain? Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: hwmon/sht15: gpio irq problem

2017-09-08 Thread Linus Walleij
On Fri, Sep 8, 2017 at 11:27 PM, Linus Walleij <linus.wall...@linaro.org> wrote: > Maybe the driver needs to be converted to use GPIO > descriptors first though :/ I got annoyed that the driver was so oldschool and sent a patch fixing this. It'd be great if you could test it!

[PATCH 6/9] hwmon: gpio-fan: Get rid of platform data struct

2017-09-25 Thread Linus Walleij
the configuration from the device tree directly into the state container members. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/hwmon/gpio-fan.c | 88 +--- 1 file changed, 30 insertions(+), 58 deletions(-) diff --git a/drivers/hwmo

[PATCH 8/9] hwmon: gpio-fan: Rename GPIO line state variables

2017-09-25 Thread Linus Walleij
global GPIO numberspace, used to control the different fan speeds. Rename these fields to "gpios" (pluralis) and "num_gpios" so as to make it unambiguous. Convert some instances of "unsigned" to "unsigned int" to keep checkpatch happy. Signed-off

[PATCH 0/9] GPIO controlled fans refactoring

2017-09-25 Thread Linus Walleij
by myself, but especially from people with fans using several GPIO lines. Linus Walleij (9): hwmon: gpio-fan: Move DT bindings to the right place hwmon: gpio-fan: Use local variable pointers hwmon: gpio-fan: Localize platform data hwmon: gpio-fan: Send around device pointer hwmon: gpio-fan

[PATCH 3/9] hwmon: gpio-fan: Localize platform data

2017-09-25 Thread Linus Walleij
h happy. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/hwmon/gpio-fan.c | 23 ++- include/linux/gpio-fan.h | 36 2 files changed, 22 insertions(+), 37 deletions(-) delete mode 100644 include/linux/gpio-fan.h diff

[PATCH 2/9] hwmon: gpio-fan: Use local variable pointers

2017-09-25 Thread Linus Walleij
Create local struct device *dev and device_node *np pointers to make the code easier to read. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/hwmon/gpio-fan.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/gpio-f

[PATCH 5/9] hwmon: gpio-fan: Mandate OF_GPIO and cut pdata path

2017-09-25 Thread Linus Walleij
We have no users of platform data, we made platform data driver-local, so cut all #ifdefs for the platform data case, and depend on the Kconfig CONFIG_OF_GPIO symbol. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/hwmon/Kconfig| 1 + drivers/hwmon/gpio-fan.

[PATCH 7/9] hwmon: gpio-fan: Get rid of the gpio alarm struct

2017-09-25 Thread Linus Walleij
There is no point in storing the GPIO alarm settings in their own struct so merge this into the main state container. Convert the variables from "unsigned" to "unsigned int" to make checkpatch happy. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- dri

[PATCH 9/9] hwmon: gpio-fan: Convert to use GPIO descriptors

2017-09-25 Thread Linus Walleij
This converts the GPIO fan driver to use GPIO descriptors. This way we avoid indirection since the gpiolib anyway just use descriptors inside, and we also get rid of explicit polarity handling: the descriptors internally knows if the line is active high or active low. Signed-off-by: Linus Walleij

Re: [9/9] hwmon: gpio-fan: Convert to use GPIO descriptors

2017-10-08 Thread Linus Walleij
On Sun, Oct 8, 2017 at 6:20 PM, Guenter Roeck <li...@roeck-us.net> wrote: > On Tue, Sep 26, 2017 at 01:09:11AM +0200, Linus Walleij wrote: >> static int fan_alarm_init(struct gpio_fan_data *fan_data) >> { >> - int err; >> int alarm_irq; >>

[PATCH 9/9 v2] hwmon: gpio-fan: Convert to use GPIO descriptors

2017-10-08 Thread Linus Walleij
This converts the GPIO fan driver to use GPIO descriptors. This way we avoid indirection since the gpiolib anyway just use descriptors inside, and we also get rid of explicit polarity handling: the descriptors internally knows if the line is active high or active low. Signed-off-by: Linus Walleij

Re: [9/9] hwmon: gpio-fan: Convert to use GPIO descriptors

2017-10-08 Thread Linus Walleij
_gpio)) > > Is this still needed ? Just wondering - I would have thought that > gpiod_get_value_cansleep() does the conversion. My bad. Fixing in V2, sending it soon. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the bo

[PATCH] hwmon: Deal with errors from the thermal subsystem

2017-12-04 Thread Linus Walleij
appear later. The sensor was still added which is incorrect: sensors must strictly be added after the thermal zones, so deferred probe must be respected. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/hwmon/hwmon.c | 17 + 1 file changed, 13 insertions

[PATCH v2] hwmon: Deal with errors from the thermal subsystem

2017-12-05 Thread Linus Walleij
appear later. The sensor was still added which is incorrect: sensors must strictly be added after the thermal zones, so deferred probe must be respected. Signed-off-by: Linus Walleij <linus.wall...@linaro.org> --- ChangeLog v1->v2: - Explicitly discard -ENODEV as this is OK, forward any other

Re: [PATCH] hwmon: Deal with errors from the thermal subsystem

2017-12-05 Thread Linus Walleij
o check for > -EPROBE_DEFER and only return this specific error, but ignore all others. Sounds more like we should ignore -ENODEV and respect all other errors? It will be more robust if some code changes and some new error code appears again. I will cook a patch like so. Yours, Linus Walleij

Re: Bridging hwmon and thermal

2017-12-03 Thread Linus Walleij
On Sun, Dec 3, 2017 at 4:39 PM, Guenter Roeck <li...@roeck-us.net> wrote: > On 12/03/2017 05:24 AM, Linus Walleij wrote: >> Is it possible to use drivers/thermal to set up a policy >> for controlling the HWMON fan directly by reading the >> HWMON sensor input periodi

Re: [PATCH] RFC: libata: Add hwmon support for SMART temperature sensors

2018-08-14 Thread Linus Walleij
On Mon, Aug 13, 2018 at 12:31 AM Guenter Roeck wrote: > On 08/09/2018 09:15 PM, Guenter Roeck wrote: > > On 08/09/2018 03:24 PM, Linus Walleij wrote: > >> +if (id == SMART_TEMP_PROP_194) > >> +break; > > 231 also seems to report the temp

Re: [PATCH] RFC: libata: Add hwmon support for SMART temperature sensors

2018-08-14 Thread Linus Walleij
like disk diagnostics and self-test etc is definately policy IMO (smartmontools even have a daemon for it, in the manpage it is stated how to instruct it to ignore the temperature beacause it "changes too often"), so the temperature of the hard disk is dubious as "policy", it

Re: [PATCH] RFC: libata: Add hwmon support for SMART temperature sensors

2018-08-14 Thread Linus Walleij
ors) instead of several which also seem sparingly maintained (hddtemp). smartmontools make good use of the data, but it has other main purposes than temperature monitoring and is a pretty big hammer for that. Yours, Linus Walleij

Re: [PATCH] RFC: libata: Add hwmon support for SMART temperature sensors

2018-08-14 Thread Linus Walleij
On Sat, Aug 11, 2018 at 9:15 PM Guenter Roeck wrote: > On Fri, Aug 10, 2018 at 12:24:25AM +0200, Linus Walleij wrote: > > + /* Names the hwmon device something like "sd_0:0:0:0" */ > > + sname = devm_kasprintf(dev, GFP_KERNEL, "sd_%s", d

[PATCH v1] libata: Add hwmon support for SMART temperature sensors

2018-08-24 Thread Linus Walleij
hddtemp" (which seems dormant) though I haven't tested it. This driver does not block any simultaneous use of other SMART userspace tools, it's a both/and approach, not either/or. Signed-off-by: Linus Walleij --- ChangeLog RFC->v1: - Put includes in alphabetical order. - Octal 00444 inst

[PATCH v2] libata: Add hwmon support for SMART temperature sensors

2018-08-26 Thread Linus Walleij
ch seems dormant) though I haven't tested it. This driver does not block any simultaneous use of other SMART userspace tools, it's a both/and approach, not either/or. Signed-off-by: Linus Walleij --- TODO: - How does this interoperate with SCSI or NVME drives? They have SMART extensions but it is

[PATCH v3] libata: Add hwmon support for SMART temperature sensors

2018-08-30 Thread Linus Walleij
ch seems dormant) though I haven't tested it. This driver does not block any simultaneous use of other SMART userspace tools, it's a both/and approach, not either/or. Reviewed-by: Guenter Roeck Signed-off-by: Linus Walleij --- TODO: - How does this interoperate with SCSI or NVME drives? They have

Re: [PATCH v5] scsi: Add hwmon support for SMART temperature sensors

2018-10-11 Thread Linus Walleij
On Mon, Oct 8, 2018 at 8:09 AM Hannes Reinecke wrote: > On 10/7/18 10:49 PM, Linus Walleij wrote: > Hmm. I might be getting something wrong here, but the main problem with > SMART values is that they are _not_ really standardized; plus any drive > is free to implement whatever they w

Re: [smartmontools-support] [PATCH v5] scsi: Add hwmon support for SMART temperature sensors

2018-10-16 Thread Linus Walleij
Hi Christian, thanks a lot for your feedback! On Tue, Oct 16, 2018 at 7:36 AM Christian Franke wrote: > Linus Walleij wrote: > > ... > > - I am uncertain if this applies to SAS drives as well, > >it appears not (Christian Frankes answer) they > >require a dif

[PATCH v6 RESEND] scsi: Add hwmon support for SMART temperature sensors

2018-11-12 Thread Linus Walleij
ors will go away with their parent devices. Reviewed-by: Guenter Roeck # HWMON Signed-off-by: Linus Walleij --- ChangeLog v5->v6: - Add the hwmon sensor on the scsi_add_lun() synchronous or scsi_sysfs_add_devices() asynchronous path. - Add a flag to drivers/usb/storage/scsiglue.c so th

[PATCH v7] scsi: Add hwmon support for SMART temperature sensors

2018-11-18 Thread Linus Walleij
registers using devm_hwmon_device_register_with_info() so hwmon sensors will go away with their parent devices. Reviewed-by: Guenter Roeck # HWMON Signed-off-by: Linus Walleij --- ChangeLog v6->v7: - Updated the commit message. - Partly bumping because SCSI maintainers seem to be ghosting the patch. I'm con

Re: [PATCH v7] scsi: Add hwmon support for SMART temperature sensors

2018-11-22 Thread Linus Walleij
just ATA. The thing/command I pass in now is ATA_16 (0x85) 16-byte pass-thru, I take it that a ATA_16 pass thru is NOT a proper command or modepage but something like an uglyhack?... Yours, Linus Walleij

Re: [hwmon:hwmon-next 88/88] FATAL: drivers/hwmon/ad7418: struct of_device_id is not terminated with a NULL entry!

2019-02-25 Thread Linus Walleij
or would you like me to send a v2? Yours, Linus Walleij

[PATCH 2/2] hwmon: (ad7418) Add device tree probing

2019-01-28 Thread Linus Walleij
This adds device tree probing for the AD7418 hwmon sensor. When device tree is not enabled, stub functions will kick in. Tested on the Gateway Cambria GW2358-4. Signed-off-by: Linus Walleij --- drivers/hwmon/ad7418.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff

[PATCH 1/2] hwmon: (ad741x) Add DT bindings for Analog Devices AD741x

2019-01-28 Thread Linus Walleij
This adds device tree bindings for Analog Devices AD741x as found in Gateway routers. Cc: devicet...@vger.kernel.org Signed-off-by: Linus Walleij --- .../devicetree/bindings/hwmon/ad741x.txt | 15 +++ 1 file changed, 15 insertions(+) create mode 100644 Documentation