mfd: syscon: Add non-DT support
Subsystems (2)
PATCH v4 1/1 mfd: syscon: Add non-DT support
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "syscon_regmap_lookup_by_pdevname" function was added.
--- drivers/mfd/Kconfig | 1 - drivers/mfd/syscon.c | 64 +++++++++++++++++++++++++++++++++------------- include/linux/mfd/syscon.h | 1 + 3 files changed, 47 insertions(+), 19 deletions(-)
drivers/mfd/Kconfig +0 -1
@@ -1070,7 +1070,6 @@ config MFD_STA2X11 config MFD_SYSCON bool "System Controller Register R/W Based on Regmap" - depends on OF select REGMAP_MMIO help Select this option to enable accessing system control registers
drivers/mfd/syscon.c +46 -18
113 lines not on this page · raw message
include/linux/mfd/syscon.h +1 -0
@@ -17,6 +17,7 @@extern struct regmap *syscon_node_to_regmap (struct device_node *np);extern struct regmap *syscon_regmap_lookup_by_compatible (const char *s); +extern struct regmap *syscon_regmap_lookup_by_pdevname (const char *s);extern struct regmap *syscon_regmap_lookup_by_phandle (struct device_node *np,const char *property);
Signature · 1 line
1.7.12.4
Re: [PATCH v4] mfd: syscon: Add non-DT suppor
Quoted 6 lines · Alexander Shiyan
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.Signed-off-by Alexander Shiyan <[email protected]>
Looks good to me now.
Quoted 6 lines · Alexander Shiyan
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.Signed-off-by Alexander Shiyan <[email protected]>
[...]
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 141
Quoted 2 lines
drivers/mfd/syscon.c +2
-0+ syscon->base =devm_ioremap_resource (dev, res); +if (!syscon->base)
Is this correct?
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 142
Quoted 2 lines
drivers/mfd/syscon.c +1
-0+return -EBUSY ;
Otherwise, i'm also ok with this patch.
BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
Regards
Dong Aisheng
Quoted 6 lines · Alexander Shiyan
Quoted 5 lines
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.
Quoted 8 lines
Quoted 1 line
Signed-off-by Alexander Shiyan <[email protected]>[...]
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 141
Quoted 2 lines
drivers/mfd/syscon.c +2
-0+ syscon->base =devm_ioremap_resource (dev, res); +if (!syscon->base)Is this correct?
Hmm, of course IS_ERR should be used here...
v5?
Quoted 9 lines
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 142
Quoted 3 lines
drivers/mfd/syscon.c +1
-0+return -EBUSY ;Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
I have same question.
---
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Quoted 10 lines · Alexander Shiyan
Quoted 10 lines · Alexander Shiyan
Quoted 6 lines
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.Signed-off-by Alexander Shiyan <[email protected]>[...]
Quoted 8 lines
Quoted 4 lines
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 141
Quoted 2 lines
drivers/mfd/syscon.c +2
-0+ syscon->base =devm_ioremap_resource (dev, res); +if (!syscon->base)Is this correct?
Hmm, of course
IS_ERRshould be used here...
v5?
Yes.
Quoted 1 line
From here:
https://lkml.org/lkml/2013/1/21/140
It seems it is.
Quoted 2 lines
Quoted 2 lines
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 142
Quoted 2 lines
drivers/mfd/syscon.c +1
-0+return -EBUSY ;
Both this line could also be changed.
Quoted 9 lines
Quoted 7 lines
Quoted 1 line
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
I have same question.
I CCed Thierry and Greg who may know it.
Regards
Dong Aisheng
Quoted 35 lines · Dong Aisheng
Quoted 10 lines · Alexander Shiyan
Quoted 10 lines · Alexander Shiyan
Quoted 6 lines
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.Signed-off-by Alexander Shiyan <[email protected]>[...]
Quoted 8 lines
Quoted 4 lines
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 141
Quoted 2 lines
drivers/mfd/syscon.c +2
-0+ syscon->base =devm_ioremap_resource (dev, res); +if (!syscon->base)Is this correct?
Hmm, of course
IS_ERRshould be used here...
v5?Yes.
Quoted 1 line
From here:
https://lkml.org/lkml/2013/1/21/140
It seems it is.Quoted 2 lines
Quoted 2 lines
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 142
Quoted 2 lines
drivers/mfd/syscon.c +1
-0+return -EBUSY ;Both this line could also be changed.
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
I have same question.
I CCed Thierry and Greg who may know it.
Yes, devm_ioremap_resource() never returns NULL. You always need to check the returned pointer with IS_ERR(). The value that you return should be extracted from the pointer with PTR_ERR().
Thierry
On Fri, Feb 22, 2013 at 08:27:19AM +0100, Thierry Reding wrote:
...
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
I have same question.
I CCed Thierry and Greg who may know it.
Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().
Thanks Thierry.
Since Samuel's mdf tree does not have your patch introducing the new API of devm_ioremap_resource,
do you know which tree this patch can go through, Greg's driver core tree?
Regards
Dong Aisheng
Quoted 12 lines · Dong Aisheng
On Fri, Feb 22, 2013 at 08:27:19AM +0100, Thierry Reding wrote:
...Quoted 10 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
I have same question.
I CCed Thierry and Greg who may know it.
Quoted 8 lines
Quoted 3 lines
Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().Thanks Thierry.
Since Samuel's mdf tree does not have your patch introducing the new API ofdevm_ioremap_resource,
do you know which tree this patch can go through, Greg's driver core tree?
I don't think it matters much at this point because Linus merged the driver core tree yesterday, so anything that gets applied now should automatically have the new API available.
Thierry
Quoted 17 lines · Thierry Reding
Quoted 16 lines · Dong Aisheng
On Fri, Feb 22, 2013 at 08:27:19AM +0100, Thierry Reding wrote:
...Quoted 13 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
I have same question.
I CCed Thierry and Greg who may know it.
Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().
Quoted 9 lines
Quoted 4 lines
Thanks Thierry.
Since Samuel's mdf tree does not have your patch introducing the new API ofdevm_ioremap_resource,
do you know which tree this patch can go through, Greg's driver core tree?I don't think it matters much at this point because Linus merged the driver core tree yesterday, so anything that gets applied now should automatically have the new API available.
I just tried update to latest linus tree, still did not find this API defined in include/linux/io.h.
Would you mind point it out for me?
Regards
Dong Aisheng
Quoted 23 lines · Dong Aisheng
Quoted 22 lines · Thierry Reding
Quoted 20 lines · Dong Aisheng
On Fri, Feb 22, 2013 at 08:27:19AM +0100, Thierry Reding wrote:
...Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
I have same question.
I CCed Thierry and Greg who may know it.
Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().Thanks Thierry.
Since Samuel's mdf tree does not have your patch introducing the new API ofdevm_ioremap_resource,
do you know which tree this patch can go through, Greg's driver core tree?
Quoted 7 lines
Quoted 4 lines
I don't think it matters much at this point because Linus merged the driver core tree yesterday, so anything that gets applied now should automatically have the new API available.
I just tried update to latest linus tree, still did not find this API defined in
include/linux/io.h.
Would you mind point it out for me?
Commit 75096579c3ac39ddc2f8b0d9a8924eba31f4d920 introduced it. The prototype is in include/linux/device.h and the implementation in lib/devres.c.
Thierry
On 22 February 2013 17:24, Thierry Reding
<[email protected]> wrote:
...
Quoted 8 lines
Quoted 3 lines
I just tried update to latest linus tree, still did not find this API defined in
include/linux/io.h.
Would you mind point it out for me?Commit
75096579c3ac39ddc2f8b0d9a8924eba31f4d920introduced it. The prototype is ininclude/linux/device.hand the implementation inlib/devres.c.
Got it.
Thanks.
Regards
Dong Aisheng
Quoted 17 lines · Dong Aisheng
Quoted 16 lines · Thierry Reding
...
Quoted 13 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Otherwise, i'm also ok with this patch.
Acked-by Dong Aisheng <[email protected]>BTW, i did not see Samuel's tree having this new API. So, who will pick this patch?
I have same question.
I CCed Thierry and Greg who may know it.
Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().
Quoted 8 lines
Quoted 4 lines
Thanks Thierry.
Since Samuel's mdf tree does not have your patch introducing the new API ofdevm_ioremap_resource,
do you know which tree this patch can go through, Greg's driver core tree?I don't think it matters much at this point because Linus merged the driver core tree yesterday, so anything that gets applied now should automatically have the new API available.
So, i will send all the three parts of the patch as v5 and keep all current CCs. Thanks.
---
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Arnd Bergmann
maintainerQuoted 21 lines · Thierry Reding
Quoted 20 lines · Dong Aisheng
Quoted 18 lines · Alexander Shiyan
Quoted 6 lines · Alexander Shiyan
Quoted 5 lines
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.Quoted 8 lines
Quoted 1 line
Signed-off-by Alexander Shiyan <[email protected]>[...]
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 141
Quoted 2 lines
drivers/mfd/syscon.c +2
-0+ syscon->base =devm_ioremap_resource (dev, res); +if (!syscon->base)Is this correct?
Hmm, of course
IS_ERRshould be used here...
v5?
Quoted 9 lines
Quoted 4 lines
Yes.
Quoted 1 line
From here:
https://lkml.org/lkml/2013/1/21/140
It seems it is.Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().
Well, devm_ioremap_resource also tries to request the resource, which as someone (Dong or Shawn?) pointed out, we should not do for the imx6q case. I think this has to be reverted to platform_get_resource and dev_ioremap.
Arnd
Quoted 32 lines · Arnd Bergmann
Quoted 21 lines · Thierry Reding
Quoted 20 lines · Dong Aisheng
Quoted 18 lines · Alexander Shiyan
Quoted 6 lines · Alexander Shiyan
Quoted 5 lines
This patch allow using syscon driver from the platform data, i.e. possibility using driver on systems without oftree support. For search syscon device from the client drivers, "
syscon_regmap_lookup_by_pdevname" function was added.Quoted 8 lines
Quoted 1 line
Signed-off-by Alexander Shiyan <[email protected]>[...]
drivers/mfd/syscon.c static struct regmap_config syscon_regmap_config = { · line 141
Quoted 2 lines
drivers/mfd/syscon.c +2
-0+ syscon->base =devm_ioremap_resource (dev, res); +if (!syscon->base)Is this correct?
Hmm, of course
IS_ERRshould be used here...
v5?Quoted 9 lines
Quoted 4 lines
Yes.
Quoted 1 line
From here:
https://lkml.org/lkml/2013/1/21/140
It seems it is.Yes,
devm_ioremap_resource()never returns NULL. You always need to check the returned pointer withIS_ERR(). The value that you return should be extracted from the pointer withPTR_ERR().
Quoted 5 lines
Well,
devm_ioremap_resourcealso tries to request the resource, which as someone (Dong or Shawn?) pointed out, we should not do for the imx6q case. I think this has to be reverted toplatform_get_resourceanddev_ioremap.
Yes, i did not see detailed devm_ioremap_resource implementation, but if it requests the resource then right, it may fail on imx6q due to request overlapped resources.
Regards
Dong Aisheng