From: Xinming Hu <[email protected]>
This patch reads hscfg_gpio from device tree and update
internal variable
Signed-off-by: Xinming Hu <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
---
drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index e486867..d28a53f 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -1459,10 +1459,21 @@ int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv,
#ifdef CONFIG_OF
struct property *prop;
size_t len = strlen(prefix);
+ u32 data;
int ret;
/* look for all matching property names */
for_each_property_of_node(node, prop) {
+ if (!strncmp(prop->name, "marvell,hscfg_gpio",
+ strlen("marvell,hscfg_gpio"))) {
+ if (!of_property_read_u32(priv->adapter->dt_node,
+ prop->name, &data)) {
+ dev_dbg(priv->adapter->dev,
+ "hscfg gpio = 0x%x\n", data);
+ priv->adapter->hs_cfg.gpio = data;
+ }
+ }
+
if (len > strlen(prop->name) ||
strncmp(prop->name, prefix, len))
continue;
--
1.8.1.4
Hi Kalle,
> -----Original Message-----
> From: Kalle Valo [mailto:[email protected]]
> Sent: Friday, December 11, 2015 2:04 PM
> To: Amitkumar Karwar
> Cc: [email protected]; Nishant Sarmukadam; Xinming Hu;
> [email protected]
> Subject: Re: [PATCH] mwifiex: parse hscfg_gpio info from device tree
>
> + devicetree list
>
> Amitkumar Karwar <[email protected]> writes:
>
> > From: Xinming Hu <[email protected]>
> >
> > This patch reads hscfg_gpio from device tree and update internal
> > variable
> >
> > Signed-off-by: Xinming Hu <[email protected]>
> > Signed-off-by: Amitkumar Karwar <[email protected]>
> > ---
> > drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> > b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> > index e486867..d28a53f 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> > @@ -1459,10 +1459,21 @@ int mwifiex_dnld_dt_cfgdata(struct
> > mwifiex_private *priv, #ifdef CONFIG_OF
> > struct property *prop;
> > size_t len = strlen(prefix);
> > + u32 data;
> > int ret;
> >
> > /* look for all matching property names */
> > for_each_property_of_node(node, prop) {
> > + if (!strncmp(prop->name, "marvell,hscfg_gpio",
> > + strlen("marvell,hscfg_gpio"))) {
> > + if (!of_property_read_u32(priv->adapter->dt_node,
> > + prop->name, &data)) {
> > + dev_dbg(priv->adapter->dev,
> > + "hscfg gpio = 0x%x\n", data);
> > + priv->adapter->hs_cfg.gpio = data;
> > + }
> > + }
>
> I don't see this documented in Documentation/devicetree/bindings. Please
> create a binding document and review it with the device tree
> maintainers.
>
> Actually when looking mwifiex close I see that it uses more undocumented
> device tree interfaces:
>
> marvell_cfgdata
> marvell,caldata
> marvell,00_txpwrlimit
>
> I think these all should be properly documented and reviewed. But I'll
> let the device tree people chime in what's the best way.
>
Thanks for the review.
Sure. We will document existing DT interfaces and create updated version of this patch which includes documentation in bindings.
Regards,
Amit
+ devicetree list
Amitkumar Karwar <[email protected]> writes:
> From: Xinming Hu <[email protected]>
>
> This patch reads hscfg_gpio from device tree and update
> internal variable
>
> Signed-off-by: Xinming Hu <[email protected]>
> Signed-off-by: Amitkumar Karwar <[email protected]>
> ---
> drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> index e486867..d28a53f 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
> @@ -1459,10 +1459,21 @@ int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv,
> #ifdef CONFIG_OF
> struct property *prop;
> size_t len = strlen(prefix);
> + u32 data;
> int ret;
>
> /* look for all matching property names */
> for_each_property_of_node(node, prop) {
> + if (!strncmp(prop->name, "marvell,hscfg_gpio",
> + strlen("marvell,hscfg_gpio"))) {
> + if (!of_property_read_u32(priv->adapter->dt_node,
> + prop->name, &data)) {
> + dev_dbg(priv->adapter->dev,
> + "hscfg gpio = 0x%x\n", data);
> + priv->adapter->hs_cfg.gpio = data;
> + }
> + }
I don't see this documented in Documentation/devicetree/bindings. Please
create a binding document and review it with the device tree
maintainers.
Actually when looking mwifiex close I see that it uses more undocumented
device tree interfaces:
marvell_cfgdata
marvell,caldata
marvell,00_txpwrlimit
I think these all should be properly documented and reviewed. But I'll
let the device tree people chime in what's the best way.
--
Kalle Valo
SGkgSnVsaWFuLA0KDQo+IEZyb206IEp1bGlhbiBDYWxhYnkgW21haWx0bzpqdWxpYW4uY2FsYWJ5
QGdtYWlsLmNvbV0NCj4gU2VudDogVGh1cnNkYXksIE1hcmNoIDE3LCAyMDE2IDQ6NTYgQU0NCj4g
VG86IEFtaXRrdW1hciBLYXJ3YXINCj4gQ2M6IEthbGxlIFZhbG87IGxpbnV4LXdpcmVsZXNzQHZn
ZXIua2VybmVsLm9yZzsgTmlzaGFudCBTYXJtdWthZGFtOw0KPiBYaW5taW5nIEh1OyBkZXZpY2V0
cmVlQHZnZXIua2VybmVsLm9yZw0KPiBTdWJqZWN0OiBSZTogW1BBVENIXSBtd2lmaWV4OiBwYXJz
ZSBoc2NmZ19ncGlvIGluZm8gZnJvbSBkZXZpY2UgdHJlZQ0KPiANCj4gSGkgQW1pdGt1bWFyLA0K
PiANCj4gT24gRnJpLCBEZWMgMTEsIDIwMTUgYXQgODoyMyBQTSwgQW1pdGt1bWFyIEthcndhciA8
YWthcndhckBtYXJ2ZWxsLmNvbT4NCj4gd3JvdGU6DQo+ID4gS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sbCxjYWxkYXRhDQo+ID4+IG1hcnZlbGwsMDBfdHhwd3JsaW1pdA0KPiA+Pg0KPiA+PiBJ
IHRoaW5rIHRoZXNlIGFsbCBzaG91bGQgYmUgcHJvcGVybHkgZG9jdW1lbnRlZCBhbmQgcmV2aWV3
ZWQuIEJ1dA0KPiA+PiBJJ2xsIGxldCB0aGUgZGV2aWNlIHRyZWUgcGVvcGxlIGNoaW1lIGluIHdo
YXQncyB0aGUgYmVzdCB3YXkuDQo+ID4+DQo+ID4NCj4gPiBUaGFua3MgZm9yIHRoZSByZXZpZXcu
DQo+ID4gU3VyZS4gV2Ugd2lsbCBkb2N1bWVudCBleGlzdGluZyBEVCBpbnRlcmZhY2VzIGFuZCBj
cmVhdGUgdXBkYXRlZA0KPiB2ZXJzaW9uIG9mIHRoaXMgcGF0Y2ggd2hpY2ggaW5jbHVkZXMgZG9j
dW1lbnRhdGlvbiBpbiBiaW5kaW5ncy4NCj4gDQo+IEl0J3MgYmVlbiBhIHdoaWxlIHNpbmNlIHRo
aXMgd2FzIHJldmlld2VkLiBEbyB5b3UgaGF2ZSBhbiB1cGRhdGVkDQo+IHZlcnNpb24gb2YgdGhp
cyBwYXRjaD8NCj4gDQoNCldlIHdpbGwgYmUgc3VibWl0dGluZyB1cGRhdGVkIHZlcnNpb24gb2Yg
YmVsb3cgcGF0Y2ggc2VyaWVzIGluIGEgZGF5IG9yIHR3by4gSGVuY2UgdXBkYXRlZCB2ZXJzaW9u
IG9mIHRoaXMgcGF0Y2ggaXMgbm90IG5lZWRlZC4NCg0KaHR0cHM6Ly9sa21sLm9yZy9sa21sLzIw
MTYvMi8yOS8zOTQNCg0KUmVnYXJkcywNCkFtaXRrdW1hcg0K
Hi Amitkumar,
On Fri, Dec 11, 2015 at 8:23 PM, Amitkumar Karwar <[email protected]> wrote:
> Hi Kalle,
>
>> -----Original Message-----
>> From: Kalle Valo [mailto:[email protected]]
>> Sent: Friday, December 11, 2015 2:04 PM
>> To: Amitkumar Karwar
>> Cc: [email protected]; Nishant Sarmukadam; Xinming Hu;
>> [email protected]
>> Subject: Re: [PATCH] mwifiex: parse hscfg_gpio info from device tree
>>
>> + devicetree list
>>
>> Amitkumar Karwar <[email protected]> writes:
>>
>> > From: Xinming Hu <[email protected]>
>> >
>> > This patch reads hscfg_gpio from device tree and update internal
>> > variable
>> >
>> > Signed-off-by: Xinming Hu <[email protected]>
>> > Signed-off-by: Amitkumar Karwar <[email protected]>
>> > ---
>> > drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 11 +++++++++++
>> > 1 file changed, 11 insertions(+)
>> >
>> > diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
>> > b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
>> > index e486867..d28a53f 100644
>> > --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
>> > +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
>> > @@ -1459,10 +1459,21 @@ int mwifiex_dnld_dt_cfgdata(struct
>> > mwifiex_private *priv, #ifdef CONFIG_OF
>> > struct property *prop;
>> > size_t len = strlen(prefix);
>> > + u32 data;
>> > int ret;
>> >
>> > /* look for all matching property names */
>> > for_each_property_of_node(node, prop) {
>> > + if (!strncmp(prop->name, "marvell,hscfg_gpio",
>> > + strlen("marvell,hscfg_gpio"))) {
>> > + if (!of_property_read_u32(priv->adapter->dt_node,
>> > + prop->name, &data)) {
>> > + dev_dbg(priv->adapter->dev,
>> > + "hscfg gpio = 0x%x\n", data);
>> > + priv->adapter->hs_cfg.gpio = data;
>> > + }
>> > + }
>>
>> I don't see this documented in Documentation/devicetree/bindings. Please
>> create a binding document and review it with the device tree
>> maintainers.
>>
>> Actually when looking mwifiex close I see that it uses more undocumented
>> device tree interfaces:
>>
>> marvell_cfgdata
>> marvell,caldata
>> marvell,00_txpwrlimit
>>
>> I think these all should be properly documented and reviewed. But I'll
>> let the device tree people chime in what's the best way.
>>
>
> Thanks for the review.
> Sure. We will document existing DT interfaces and create updated version of this patch which includes documentation in bindings.
It's been a while since this was reviewed. Do you have an updated
version of this patch?
Thanks,
--
Julian Calaby
Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/