[lm-sensors] [PATCH V2] hwmon: Add MCP3021 hardware monitoring driver

Guenter Roeck guenter.roeck at ericsson.com
Wed Feb 8 23:18:18 CET 2012


On Wed, 2012-02-08 at 17:00 -0500, Jean Delvare wrote:
> Hi Xie,
> 
> On Sun, 5 Feb 2012 20:33:38 +0800, Xie Xiaobo wrote:
> > Add I2C driver for MCP3021 that is an ADC chip from Microchip.
> > The MCP3021 is a successive approximation A/D converter (ADC)
> > with 10-bit resolution.
> > The driver export the value of Vin to sysfs, the voltage unit is
> > mV. Through the sysfs interface, lm-sensors tool can also display
> > Vin voltage.
> > 
> > Signed-off-by: Mingkai Hu <Mingkai.hu at freescale.com>
> > Signed-off-by: Xie Xiaobo <X.Xie at freescale.com>
> > ---
> > ---
> 
Odd, I didn't get a copy of this patch. Guess I am fighting with the
corporate e-mail system again :(. Thanks for looking into it.

Additional minor comment below.

[ ... ]

> > +
> > +static int __init mcp3021_init(void)
> > +{
> > +	return i2c_add_driver(&mcp3021_driver);
> > +}
> > +
> > +static void __exit mcp3021_exit(void)
> > +{
> > +	i2c_del_driver(&mcp3021_driver);
> > +}
> > +
> > +MODULE_AUTHOR("Mingkai Hu <Mingkai.hu at freescale.com>");
> > +MODULE_DESCRIPTION("Microchip MCP3021 driver");
> > +MODULE_LICENSE("GPL");
> > +
> > +module_init(mcp3021_init);
> > +module_exit(mcp3021_exit);
> 

The init/exit functions and module_init/module_exit can now be replaced
with module_i2c_driver(mcp3021_driver);

Guenter






More information about the lm-sensors mailing list