Message ID | 20210830172140.414-2-caihuoqing@baidu.com |
---|---|
State | New |
Headers | show |
Series | [1/6] iio: adc: Init the driver for NXP i.MX8QuadXPlus | expand |
Hi Cai, On Mon, Aug 30, 2021 at 2:22 PM Cai Huoqing <caihuoqing@baidu.com> wrote: > +static int imx8qxp_adc_probe(struct platform_device *pdev) > +{ > + return 0; > +} This is not the correct way to split the series. Patches 1, 2, 3, and 5 could be squashed into a single patch. Thanks
On Tue, 31 Aug 2021 01:21:35 +0800 Cai Huoqing <caihuoqing@baidu.com> wrote: > ADC > > The NXP i.MX 8QuadXPlus SOC has a new ADC IP. This patch init > this ADC driver. > > Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> > --- > drivers/iio/adc/imx8qxp-adc.c | 67 +++++++++++++++++++++++++++++++++++ > 1 file changed, 67 insertions(+) > create mode 100644 drivers/iio/adc/imx8qxp-adc.c > > diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c > new file mode 100644 > index 000000000000..aec1b45c8fb9 > --- /dev/null > +++ b/drivers/iio/adc/imx8qxp-adc.c > @@ -0,0 +1,67 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * NXP i.MX8QXP ADC driver > + */ > + > +#include <linux/clk.h> > +#include <linux/completion.h> > +#include <linux/err.h> > +#include <linux/interrupt.h> > +#include <linux/io.h> > +#include <linux/kernel.h> > +#include <linux/delay.h> > +#include <linux/module.h> > +#include <linux/pm_runtime.h> > +#include <linux/platform_device.h> > +#include <linux/regulator/consumer.h> > +#include <linux/iio/iio.h> > +#include <linux/iio/driver.h> > +#include <linux/iio/sysfs.h> A good example of why you shouldn't have had so many small patches is that reviewers want to look at a patch on it's own. In this case we can't tell if you are going to use these headers later or not. Hence review is more complex. I'll have a brief go at reviewing, but reality is a real review needs to be easier to do than it is here! I will note though that alphabetical order, perhaps with iio includes in their own block is preferred for headers in IIO drivers. > + > +#define ADC_DRIVER_NAME "imx8qxp-adc" > + > +static int imx8qxp_adc_probe(struct platform_device *pdev) > +{ > + return 0; > +} > + > +static int imx8qxp_adc_remove(struct platform_device *pdev) > +{ > + return 0; > +} > + > +static int imx8qxp_adc_runtime_suspend(struct device *dev) > +{ > + return 0; > +} > + > +static int imx8qxp_adc_runtime_resume(struct device *dev) > +{ > + return 0; > +} > + > +static const struct dev_pm_ops imx8qxp_adc_pm_ops = { > + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) > + SET_RUNTIME_PM_OPS(imx8qxp_adc_runtime_suspend, imx8qxp_adc_runtime_resume, NULL) > +}; > + > +static const struct of_device_id imx8qxp_adc_match[] = { > + { .compatible = "nxp,imx8qxp-adc", }, > + { /* sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, imx8qxp_adc_match); > + > +static struct platform_driver imx8qxp_adc_driver = { > + .probe = imx8qxp_adc_probe, > + .remove = imx8qxp_adc_remove, > + .driver = { > + .name = ADC_DRIVER_NAME, > + .of_match_table = imx8qxp_adc_match, > + .pm = &imx8qxp_adc_pm_ops, > + }, > +}; > + > +module_platform_driver(imx8qxp_adc_driver); > + > +MODULE_DESCRIPTION("i.MX8QuadXPlus ADC driver"); > +MODULE_LICENSE("GPL v2");
diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c new file mode 100644 index 000000000000..aec1b45c8fb9 --- /dev/null +++ b/drivers/iio/adc/imx8qxp-adc.c @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * NXP i.MX8QXP ADC driver + */ + +#include <linux/clk.h> +#include <linux/completion.h> +#include <linux/err.h> +#include <linux/interrupt.h> +#include <linux/io.h> +#include <linux/kernel.h> +#include <linux/delay.h> +#include <linux/module.h> +#include <linux/pm_runtime.h> +#include <linux/platform_device.h> +#include <linux/regulator/consumer.h> +#include <linux/iio/iio.h> +#include <linux/iio/driver.h> +#include <linux/iio/sysfs.h> + +#define ADC_DRIVER_NAME "imx8qxp-adc" + +static int imx8qxp_adc_probe(struct platform_device *pdev) +{ + return 0; +} + +static int imx8qxp_adc_remove(struct platform_device *pdev) +{ + return 0; +} + +static int imx8qxp_adc_runtime_suspend(struct device *dev) +{ + return 0; +} + +static int imx8qxp_adc_runtime_resume(struct device *dev) +{ + return 0; +} + +static const struct dev_pm_ops imx8qxp_adc_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + SET_RUNTIME_PM_OPS(imx8qxp_adc_runtime_suspend, imx8qxp_adc_runtime_resume, NULL) +}; + +static const struct of_device_id imx8qxp_adc_match[] = { + { .compatible = "nxp,imx8qxp-adc", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx8qxp_adc_match); + +static struct platform_driver imx8qxp_adc_driver = { + .probe = imx8qxp_adc_probe, + .remove = imx8qxp_adc_remove, + .driver = { + .name = ADC_DRIVER_NAME, + .of_match_table = imx8qxp_adc_match, + .pm = &imx8qxp_adc_pm_ops, + }, +}; + +module_platform_driver(imx8qxp_adc_driver); + +MODULE_DESCRIPTION("i.MX8QuadXPlus ADC driver"); +MODULE_LICENSE("GPL v2");
ADC The NXP i.MX 8QuadXPlus SOC has a new ADC IP. This patch init this ADC driver. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> --- drivers/iio/adc/imx8qxp-adc.c | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 drivers/iio/adc/imx8qxp-adc.c