RE: [PATCH v3] gpio: mpc8xxx: Add ACPI support

2021-03-21 Thread Ran Wang
Hi Andy,

On Friday, March 19, 2021 6:32 PM, Andy Shevchenko wrote:
> 
> On Fri, Mar 19, 2021 at 10:10 AM Ran Wang  wrote:
> >
> > Current implementation only supports DT, now add ACPI support.
> 
> Thanks for an update, my comments below.
> 
> ...
> 
> > +#include 
> 
> Missed
> property.h
> mod_devicetable.h.

Got it.
 
> ...
> 
> > -   mpc8xxx_gc->regs = of_iomap(np, 0);
> > +   mpc8xxx_gc->regs = devm_platform_ioremap_resource(pdev, 0);
> 
> > if (!mpc8xxx_gc->regs)
> 
> This is wrong now.

Yes, will correct this in next version

> > return -ENOMEM;
> 
> This too.

Got it.
 
> ...
> 
> > +   fwnode = dev_fwnode(>dev);
> > if (of_device_is_compatible(np, "fsl,qoriq-gpio") ||
> > of_device_is_compatible(np, "fsl,ls1028a-gpio") ||
> > -   of_device_is_compatible(np, "fsl,ls1088a-gpio"))
> > +   of_device_is_compatible(np, "fsl,ls1088a-gpio") ||
> 
> > +   !(IS_ERR_OR_NULL(fwnode) || is_of_node(fwnode)))
> 
> Since you left acpi.h inclusion, you may switch this to
> 
> is_acpi_node(fwnode)
> 
> or drop fwnode and use
> 
> has_acpi_companion(>dev)

OK, will use is_acpi_node(fwnode) instead (since fwnode is referred in 
following irq_domain_create_linear()

Thanks for your patient educate :)

Regards,
Ran



Re: [PATCH v3] gpio: mpc8xxx: Add ACPI support

2021-03-19 Thread Andy Shevchenko
On Fri, Mar 19, 2021 at 10:10 AM Ran Wang  wrote:
>
> Current implementation only supports DT, now add ACPI support.

Thanks for an update, my comments below.

...

> +#include 

Missed
property.h
mod_devicetable.h.

...

> -   mpc8xxx_gc->regs = of_iomap(np, 0);
> +   mpc8xxx_gc->regs = devm_platform_ioremap_resource(pdev, 0);

> if (!mpc8xxx_gc->regs)

This is wrong now.

> return -ENOMEM;

This too.

...

> +   fwnode = dev_fwnode(>dev);
> if (of_device_is_compatible(np, "fsl,qoriq-gpio") ||
> of_device_is_compatible(np, "fsl,ls1028a-gpio") ||
> -   of_device_is_compatible(np, "fsl,ls1088a-gpio"))
> +   of_device_is_compatible(np, "fsl,ls1088a-gpio") ||

> +   !(IS_ERR_OR_NULL(fwnode) || is_of_node(fwnode)))

Since you left acpi.h inclusion, you may switch this to

is_acpi_node(fwnode)

or drop fwnode and use

has_acpi_companion(>dev)

> gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0x);


-- 
With Best Regards,
Andy Shevchenko