Re: [PATCH 1/2] pinctrl: qcom: handle tiles for ACPI boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 01, 2021 at 04:34:30PM +0200, Andy Shevchenko wrote:
> On Mon, Mar 01, 2021 at 09:43:28AM +0800, Shawn Guo wrote:
> > It's not always the case that DT and ACPI describe hardware resource in
> > the same schema, even for a single platform.  For example, on SC8180X,
> > DT uses the tiles schema while ACPI describe memory resource as a single
> > region.  It patches msm_pinctrl_probe() function to map tiles regions
> > only for DT.  While for ACPI, it maps the single memory resource and
> > calculate tile bases with offsets passed from SoC data.
> 
> ...
> 
> > +#include <linux/acpi.h>
> 
> No use of this header. See below.
> (Perhaps you meant mod_devicetable.h)

has_acpi_companion() call needs the header.

> 
> ...
> 
> > -	if (soc_data->tiles) {
> > +	if (soc_data->tiles && !has_acpi_companion(&pdev->dev)) {
> 
> Any documentation to understand this change?

Well, !has_acpi_companion() is just to rule out ACPI boot and ensure
this is a DT boot with tiles. 

> 
> ...
> 
> > +		if (soc_data->tiles) {
> > +			for (i = 0; i < soc_data->ntiles; i++)
> > +				pctrl->regs[i] = base +
> > +						 soc_data->tile_offsets[i];
> > +		} else {
> > +			pctrl->regs[0] = base;
> > +		}
> 
> And so this?

For ACPI boot or DT without tiles, there is only one single memory
resource to map.  But for SoC driver like pinctrl-sc8180x that defines
pins with tiles, even with ACPI boot, we need to have multiple regs[]
to hold bases for tiles.

I will add comment to make it easier for understanding.

Shawn



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux