Re: [PATCH 2/3] hwmon: add Texas Instruments TPS23861 driver

From: Guenter Roeck
Date: Fri Dec 18 2020 - 09:51:14 EST


On 12/18/20 5:03 AM, Robert Marko wrote:
> Add basic monitoring support as well as port on/off control for Texas
> Instruments TPS23861 PoE PSE IC.
>
> Signed-off-by: Robert Marko <robert.marko@xxxxxxxxxx>
> Cc: Luka Perkov <luka.perkov@xxxxxxxxxx>
> ---
> drivers/hwmon/Kconfig | 11 ++
> drivers/hwmon/Makefile | 1 +
> drivers/hwmon/tps23861.c | 398 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 410 insertions(+)
> create mode 100644 drivers/hwmon/tps23861.c
>
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index a850e4f0e0bd..3368ecfa7a9c 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -1102,6 +1102,17 @@ config SENSORS_TC654
> This driver can also be built as a module. If so, the module
> will be called tc654.
>
> +config SENSORS_TPS23861
> + tristate "Texas Instruments TPS23861 PoE PSE"
> + depends on I2C
> + select REGMAP_I2C
> + help
> + If you say yes here you get support for Texas Instruments
> + TPS23861 802.3at PoE PSE chips.
> +
> + This driver can also be built as a module. If so, the module
> + will be called tps23861.
> +
> config SENSORS_MENF21BMC_HWMON
> tristate "MEN 14F021P00 BMC Hardware Monitoring"
> depends on MFD_MENF21BMC
> diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
> index 9db2903b61e5..7493e9d5dc43 100644
> --- a/drivers/hwmon/Makefile
> +++ b/drivers/hwmon/Makefile
> @@ -141,6 +141,7 @@ obj-$(CONFIG_SENSORS_MAX31790) += max31790.o
> obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
> obj-$(CONFIG_SENSORS_MCP3021) += mcp3021.o
> obj-$(CONFIG_SENSORS_TC654) += tc654.o
> +obj-$(CONFIG_SENSORS_TPS23861) += tps23861.o
> obj-$(CONFIG_SENSORS_MLXREG_FAN) += mlxreg-fan.o
> obj-$(CONFIG_SENSORS_MENF21BMC_HWMON) += menf21bmc_hwmon.o
> obj-$(CONFIG_SENSORS_MR75203) += mr75203.o
> diff --git a/drivers/hwmon/tps23861.c b/drivers/hwmon/tps23861.c
> new file mode 100644
> index 000000000000..e8b614267084
> --- /dev/null
> +++ b/drivers/hwmon/tps23861.c
> @@ -0,0 +1,398 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Driver for the TI TPS23861 PoE PSE.
> + *
> + * Author: Robert Marko <robert.marko@xxxxxxxxxx>
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/hwmon.h>
> +#include <linux/hwmon-sysfs.h>
> +#include <linux/i2c.h>
> +#include <linux/regmap.h>
> +#include <linux/bitfield.h>
> +#include <linux/delay.h>

Alphabetic include file order, please.

[ ... ]

> + hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
> + data, tps23861_groups);

Please rework to use devm_hwmon_device_register_with_info().

Thanks,
Guenter