Message ID | 20201218130329.258254-1-robert.marko@sartura.hr |
---|---|
State | Superseded |
Headers | show |
Series | [1/3] dt-bindings: hwmon: Add TI TPS23861 bindings | expand |
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@sartura.hr> > Cc: Luka Perkov <luka.perkov@sartura.hr> > --- > 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@sartura.hr> > + */ > + > +#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
On Fri, Dec 18, 2020 at 3:50 PM Guenter Roeck <linux@roeck-us.net> wrote: > > 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@sartura.hr> > > Cc: Luka Perkov <luka.perkov@sartura.hr> > > --- > > 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@sartura.hr> > > + */ > > + > > +#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. Done in v2. > > [ ... ] > > > + hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, > > + data, tps23861_groups); > > Please rework to use devm_hwmon_device_register_with_info(). Done in v2. Thanks for the remarks. Regards, Robert > > Thanks, > Guenter
diff --git a/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml b/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml new file mode 100644 index 000000000000..a7a801f54398 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/hwmon/ti,tps23861.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI TPS23861 PoE PSE + +maintainers: + - Robert Marko <robert.marko@sartura.hr> + +description: | + The TPS23861 is a IEEE 802.3at Quad Port Power-over-Ethernet PSE Controller. + + Datasheets: + https://www.ti.com/lit/gpn/tps23861 + + +properties: + compatible: + enum: + - ti,tps23861 + + reg: + maxItems: 1 + + shunt-resistor-micro-ohms: + description: | + The value of curent sense resistor in microohms. + items: + default: 255000 + minimum: 250000 + maximum: 255000 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + tps23861@30 { + compatible = "ti,tps23861"; + reg = <0x30>; + shunt-resistor-micro-ohms = <255000>; + }; + };
Document bindings for the Texas Instruments TPS23861 driver. Signed-off-by: Robert Marko <robert.marko@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr> --- .../bindings/hwmon/ti,tps23861.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/ti,tps23861.yaml