Re: [PATCH] pinctrl: phandle entries will be applied sequentially

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

 




On Wed, Oct 09, 2013 at 03:09:21PM +0200, Linus Walleij wrote:
> When I look at the i.MX driver (I guess this is what Shawn
> is working on here) it can actually be augmented to do it
> the same way and avoid this mess altogether:
> 
>        for (i = 0; i < num_configs; i++) {
>                 if (info->flags & SHARE_MUX_CONF_REG) {
>                         u32 reg;
>                         reg = readl(ipctl->base + pin_reg->conf_reg);
>                         reg &= ~0xffff;
>                         reg |= configs[i];
>                         writel(reg, ipctl->base + pin_reg->conf_reg);
>                 } else {
>                         writel(configs[i], ipctl->base + pin_reg->conf_reg);
>                 }
>                 dev_dbg(ipctl->dev, "write: offset 0x%x val 0x%lx\n",
>                         pin_reg->conf_reg, configs[i]);
>         } /* for each config */
> 
> As can be seen it will just writel() the config into the register
> for each config, it seems more like there is a bug that also
> the else-clause here should be read-modify-write, or am
> I getting it all wrong?

On imx, num_configs is always 1 (new_map[j].data.configs.num_configs
is hard-coded as 1 in imx_dt_node_to_map() function).  We have all
configs for given pin encoded in the last integer of fsl,pin entry.
And this integer can be directly written into conf_reg.

Shawn

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux