Commit Graph

13 Commits

Author SHA1 Message Date
Uwe Kleine-König
d8a66f3621 hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240430085654.1028864-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-05-01 07:47:49 -07:00
Guenter Roeck
cb7222997e hwmon: (pmbus/ir38064) Use PMBUS_REGULATOR_ONE to declare regulator
If a chip only provides a single regulator, it should be named 'vout'
and not 'vout0'. Declare regulator using PMBUS_REGULATOR_ONE() to make
that happen.

Cc: Conor Dooley <conor@kernel.org>
Cc: Naresh Solanki <naresh.solanki@9elements.com>
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240223-harmless-covenant-9cd3d4f1cfd2@spud
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-02-25 12:37:46 -08:00
Rob Herring
39f034386f hwmon: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174607.4057185-1-robh@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21 06:04:29 -07:00
Uwe Kleine-König
1975d16786 hwmon: Switch i2c drivers back to use .probe()
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de
[groeck: Added missing change in pmbus/acbel-fsg032.c]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08 06:41:17 -07:00
Guenter Roeck
f1e75e0d6a hwmon: (pmbus/ir38064) Mark ir38064_of_match as __maybe_unused
If CONFIG_PM is not enabled, the following warning is reported.

drivers/hwmon/pmbus/ir38064.c:54:34: warning:
	unused variable 'ir38064_of_match'

Mark it as __maybe_unused.

Reported-by: kernel test robot <lkp@intel.com>
Cc: Arthur Heymans <arthur.heymans@9elements.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-01-23 18:21:27 -08:00
Colin Ian King
23c7df14f6 hwmon/pmbus: (ir38064) Fix spelling mistake "comaptible" -> "compatible"
There is a spelling mistake in the module description, fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20211220155527.179125-1-colin.i.king@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-12-26 15:02:07 -08:00
Patrick Rudolph
0ee7f62426 hwmon/pmbus: (ir38064) Expose a regulator
The chip series supported by this driver are voltage regulators, so expose
them to the regulator subsystem.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20211213142814.264802-4-arthur.heymans@9elements.com
[groeck: Added brief patch description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-12-26 15:02:07 -08:00
Arthur Heymans
e65de225ef hwmon/pmbus: (ir38064) Add of_match_table
Add the missing of_match_table to allow device tree probing.

Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
Link: https://lore.kernel.org/r/20211213142814.264802-3-arthur.heymans@9elements.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-12-26 15:02:07 -08:00
Patrick Rudolph
ca003af3aa hwmon/pmbus: (ir38064) Add support for IR38060, IR38164 IR38263
The IR38060, IR38164 and IR38263 can be supported using this driver.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Arthur Heymans <arthur.heymans@9elements.com>
Link: https://lore.kernel.org/r/20211213142814.264802-2-arthur.heymans@9elements.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-12-26 15:02:07 -08:00
Guenter Roeck
b94ca77eea hwmon: (pmbus) Introduce PMBUS symbol namespace
Exported pmbus symbols are only supposed to be used from PMBus code.
Introduce PMBUS symbol namespace to prevent misuse from other code.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2021-04-20 06:50:14 -07:00
Bartosz Golaszewski
3bce071a30 hwmon: (pmbus) shrink code and remove pmbus_do_remove()
The only action currently performed in pmbus_do_remove() is removing the
debugfs hierarchy. We can schedule a devm action at probe time and remove
pmbus_do_remove() entirely from all pmbus drivers.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20201026105352.20359-1-brgl@bgdev.pl
[groeck: Removed references to pmbus_do_remove from documentation]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-12-02 17:42:23 -08:00
Stephen Kitt
dd43193976 hwmon (pmbus) use simple i2c probe function
pmbus_do_probe doesn't use the id information provided in its second
argument, so this can be removed, which then allows using the
single-parameter i2c probe function ("probe_new") for probes.

This avoids scanning the identifier tables during probes.

Drivers which didn't use the id are converted as-is; drivers which did
are modified as follows:

* if the information in i2c_client is sufficient, that's used instead
  (client->name);
* configured v. probed comparisons are performed by comparing the
  configured name to the detected name, instead of the ids; this
  involves strcmp but is still cheaper than comparing all the device
  names when scanning the tables;
* anything else is handled by calling i2c_match_id() with the same
  level of error-handling (if any) as before.

Additionally, the mismatch message in the ltc2978 driver is adjusted
so that it no longer assumes that the driver_data is an index into
ltc2978_id.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Acked-by: Wolfram Sang <wsa@kernel.org>
Link: https://lore.kernel.org/r/20200808210004.30880-1-steve@sk2.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-09-23 09:42:39 -07:00
Maxim Sloyko
00669d196c hwmon: (pmbus/ir38064) Add driver for Infineon IR38064 Voltage Regulator
Add the pmbus driver for the Infineon ir38064 voltage regulator.

VOUT_MODE is not supported by the device.  The driver fakes linear16
mode with exponent value -8.

The device supports VOUT_PEAK, IOUT_PEAK, and TEMPERATURE_PEAK, however
this driver does not enable them.

Signed-off-by: Maxim Sloyko <maxims@google.com>
Signed-off-by: Patrick Venture <venture@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-04-15 17:19:53 -07:00