Thread (40 messages) 40 messages, 7 authors, 2011-12-15

[RFC PATCH v2 4/4] mmc: sdhci-esdhc-imx: using pinmux subsystem

From: Shawn Guo <hidden>
Date: 2011-12-15 06:56:34
Also in: lkml

On Wed, Dec 14, 2011 at 11:15:53PM +0100, Linus Walleij wrote:
On Wed, Dec 14, 2011 at 10:11 PM, Sascha Hauer [off-list ref] wrote:
quoted
On Thu, Dec 15, 2011 at 12:03:42AM +0800, Dong Aisheng wrote:
quoted
quoted
+ ? ? pmx = pinmux_get(&pdev->dev, NULL);
+ ? ? if (IS_ERR(pmx)) {
+ ? ? ? ? ? ? err = PTR_ERR(pmx);
+ ? ? ? ? ? ? goto err_pmx_get;
+ ? ? }
+ ? ? err = pinmux_enable(pmx);
+ ? ? if (err)
+ ? ? ? ? ? ? goto err_pmx_enable;
+ ? ? imx_data->pmx = pmx;
+
Won't this break every i.MX except i.MX6?
It will not if we do not compile other imx together with imx6, because
there are a set of empty functions defined in
include/linux/pinctrl/pinmux.h for those builds without pinctrl enabled.
But yes, it's actually broken since we are on the way to compile imx3,
imx5 and imx6 as single image.
Not this patch on its own, first the machines have to
select PINCTRL
select PINMUX_FOO

*Then* it will break :-D

So if you want to do this for i.MX you need something like
selectable dummy pinmuxes, i.e. pinmux_get() to return something
that just say "OK" to everything like the dummy regulators.

Shall I try to create something like that?
Isn't the empty functions defined in include/linux/pinctrl/pinmux.h
for this purpose?  It does not solve the problem with single image.
You might probably mean that we create a dummy_pinctrl_desc and register
it to pinctrl core with pinctrl_register() if we detect that the kernel
is running on a soc that has no pinctrl support?

This is not a problem to pinctrl migration only.  We have the same
problem with common clk migration.  Unless we migrate imx3, imx5 and
imx6 to common clk at the same time, single image build just does not
cope with clk_* api.

-- 
Regards,
Shawn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help