Re: [PATCH v3 1/3] iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAHp75Vcd-A84KxiCsZpv3y=G-WW8H7GpZ2Y2G7BAnGsVL6Vjiw@mail.gmail.com> |
On Tue, Aug 4, 2026 at 4:30 PM Ariana Lazar <[email protected]> wrote: > > Prepare the driver for the bus-specific code by refactoring into separate > files. The renamed file will contain the common DAC functionality shared by > the MCP47FxBy1/2/4/8 I2C and MCP48FxBy1/2/4/8 SPI drivers. The MCP47FEB02 > driver was refactored into two modules: mcp47feb02-core.c and > mcp47feb02-i2c.c in order to prepare the support for SPI MCP48FxBy1/2/4/8 > DAC family on top of the current implementation. ... > +MCP47FEB02_CHIP_INFO(mcp47feb22, 2, 12, false, true); > +MCP47FEB02_CHIP_INFO(mcp47feb24, 4, 12, true, true); > +MCP47FEB02_CHIP_INFO(mcp47feb28, 8, 12, true, true); You need to add a header for 'true' and 'false'. ... > +++ b/drivers/iio/dac/mcp47feb02.h > +/* SPDX-License-Identifier: GPL-2.0+ */ > +#ifndef __DRIVERS_IIO_DAC_MCP47FEB02_H__ > +#define __DRIVERS_IIO_DAC_MCP47FEB02_H__ > + > +#include <linux/bits.h> Not used > +#include <linux/mutex.h> Not used > +#include <linux/regmap.h> > +#include <linux/regulator/consumer.h> Not used > +#include <linux/types.h> > + > +extern const char * const mcp47feb02_powerdown_modes[]; > + > +/* Macro used for generating chip features structures */ > +#define MCP47FEB02_CHIP_INFO(_name, _channels, _res, _vref1, _eeprom) \ > +static const struct mcp47feb02_features _name##_chip_features = { \ > + .name = #_name, \ > + .phys_channels = _channels, \ > + .resolution = _res, \ > + .have_ext_vref1 = _vref1, \ > + .have_eeprom = _eeprom, \ > +} > + > +/** > + * struct mcp47feb02_features - chip specific data > + * @name: device name > + * @phys_channels: number of hardware channels > + * @resolution: DAC resolution > + * @have_ext_vref1: does the hardware have an the second external voltage reference? > + * @have_eeprom: does the hardware have an internal eeprom? > + */ > +struct mcp47feb02_features { > + const char *name; > + unsigned int phys_channels; > + unsigned int resolution; > + bool have_ext_vref1; > + bool have_eeprom; > +}; > + > +extern const struct regmap_config mcp47feb02_regmap_config; > +extern const struct regmap_config mcp47fvb02_regmap_config; > + > +/* Properties shared by I2C and SPI families */ > +int mcp47feb02_common_probe(const struct mcp47feb02_features *chip_features, struct regmap *regmap); > + > +extern const struct dev_pm_ops mcp47feb02_pm_ops; Missed header for struct dev_pm_ops definition. > +#endif /* __DRIVERS_IIO_DAC_MCP47FEB02_H__ */ -- With Best Regards, Andy Shevchenko