[PATCH 2/2] pinctrl: imx: add driver for i.MX8MQ

Lucas Stach l.stach at pengutronix.de
Thu Jan 18 04:44:08 PST 2018


Hi Stefan,

Am Donnerstag, den 18.01.2018, 13:41 +0100 schrieb stefan at agner.ch:
> Hi Lucas,
> 
> On 17.01.2018 19:28, Lucas Stach wrote:
> > The i.MX8MQ pincontrol works in a similar way to the earlier i.MX
> > SoCs.
> > 
> > The driver code is largely copied from NXP's downstream driver
> > written
> > by Anson Huang. Only some small changes for upstream adaption are
> > done
> > by myself.
> > 
> > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > ---
[...]

> > +static struct imx_pinctrl_soc_info imx8mq_pinctrl_info = {
> > +	.pins = imx8mq_pinctrl_pads,
> > +	.npins = ARRAY_SIZE(imx8mq_pinctrl_pads),
> > +	.gpr_compatible = "nxp,imx8mq-iomuxc-gpr",
> > +};
> 
> I recently sent a patchset which allow to pass the struct
> imx_pinctrl_soc_info as const to imx_pinctrl_probe, hence this should
> be
> const.
> 
> See:
> https://lkml.org/lkml/2018/1/6/131
> 
> > +
> > +static struct of_device_id imx8mq_pinctrl_of_match[] = {
> > +	{ .compatible = "nxp,imx8mq-iomuxc", .data =
> > &imx8mq_pinctrl_info, },
> > +	{ /* sentinel */ }
> > +};
> > +
> > +static int imx8mq_pinctrl_probe(struct platform_device *pdev)
> > +{
> > +	const struct of_device_id *match;
> > +	struct imx_pinctrl_soc_info *pinctrl_info;
> > +
> > +	match = of_match_device(imx8mq_pinctrl_of_match, &pdev-
> > >dev);
> > +
> > +	if (!match)
> > +		return -ENODEV;
> > +
> > +	pinctrl_info = (struct imx_pinctrl_soc_info *) match-
> > >data;
> 
> ...and allow to make use of of_device_get_match_data 

Thanks for the hint, I'll change this for the next revision of this
patch.

Regards,
Lucas



More information about the linux-arm-kernel mailing list