From: Mugunthan V N <hidden> Date: 2013-05-21 09:54:57
Resending the same patch series as it is dropped which was sent
during merge window
This patch series adds the following features
* Adding pinctrl PM support for CPSW and MDIO for Power Optimization
* Adding phy address to the CPSW node for EVMsk board
Hebbar Gururaja (1):
net: cpsw: enhance pinctrl support
Mugunthan V N (5):
net: davinci_mdio: enhance pinctrl support
ARM: dts: AM33XX: Add pinmux configuration for CPSW to beaglebone
ARM: dts: AM33XX: Add CPSW phy_id device tree data to am335x-evmsk
ARM: dts: AM33XX: Add pinmux configuration for CPSW to EVMsk
ARM: dts: AM33XX: Add pinmux configuration for CPSW to am335x EVM
arch/arm/boot/dts/am335x-bone.dts | 38 +++++++++++++++++++++
arch/arm/boot/dts/am335x-evm.dts | 36 ++++++++++++++++++++
arch/arm/boot/dts/am335x-evmsk.dts | 58 ++++++++++++++++++++++++++++++++
drivers/net/ethernet/ti/cpsw.c | 49 +++++++++++++++++++++++++++
drivers/net/ethernet/ti/davinci_mdio.c | 46 +++++++++++++++++++++++++
5 files changed, 227 insertions(+)
--
1.7.9.5
From: Mugunthan V N <hidden> Date: 2013-05-21 09:54:58
From: Hebbar Gururaja <redacted>
Amend cpsw controller to optionally take a pin control handle and set
the state of the pins to:
- "default" on boot, resume
- "sleep" on suspend()
This should make it possible to optimize energy usage for the pins
for the suspend/resume cycle.
If any of the above pin states are missing in dt, a warning message
about the missing state is displayed.
If certain pin-states are not available, to remove this warning message
pass respective state name with null phandler.
Signed-off-by: Hebbar Gururaja <redacted>
Signed-off-by: Mugunthan V N <redacted>
---
drivers/net/ethernet/ti/cpsw.c | 49 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
@@ -1689,6 +1695,36 @@ static int cpsw_probe(struct platform_device *pdev)*/pm_runtime_enable(&pdev->dev);+priv->pinctrl=devm_pinctrl_get(&pdev->dev);+if(!IS_ERR(priv->pinctrl)){+priv->pins_default=pinctrl_lookup_state(priv->pinctrl,+PINCTRL_STATE_DEFAULT);+/* enable pins to be muxed in and configured */+if(IS_ERR(priv->pins_default))+dev_warn(&pdev->dev,"could not get default pinstate\n");+else+if(pinctrl_select_state(priv->pinctrl,+priv->pins_default))+dev_err(&pdev->dev,+"could not set default pins\n");++priv->pins_sleep=pinctrl_lookup_state(priv->pinctrl,+PINCTRL_STATE_SLEEP);+if(IS_ERR(priv->pins_sleep))+dev_warn(&pdev->dev,"could not get sleep pinstate\n");+}else{+/*+*Sincewecontinueevenwhenpinctrlnodeisnotfound,+*Invalidatepinsasnotavailable.Thisistomakesurethat+*IS_ERR(pins_xxx)resultsinfailurewhenused.+*/+priv->pins_default=ERR_PTR(-ENODATA);+priv->pins_sleep=ERR_PTR(-ENODATA);++dev_warn(&pdev->dev,+"pins are not configured from the driver\n");+}+if(cpsw_probe_dt(&priv->data,pdev)){pr_err("cpsw: platform data missing\n");ret=-ENODEV;
@@ -1973,11 +2009,17 @@ static int cpsw_suspend(struct device *dev){structplatform_device*pdev=to_platform_device(dev);structnet_device*ndev=platform_get_drvdata(pdev);+structcpsw_priv*priv=netdev_priv(ndev);if(netif_running(ndev))cpsw_ndo_stop(ndev);pm_runtime_put_sync(&pdev->dev);+/* Optionally let pins go into sleep states */+if(!IS_ERR(priv->pins_sleep))+if(pinctrl_select_state(priv->pinctrl,priv->pins_sleep))+dev_err(dev,"could not set pins to sleep state\n");+return0;}
@@ -1985,8 +2027,15 @@ static int cpsw_resume(struct device *dev){structplatform_device*pdev=to_platform_device(dev);structnet_device*ndev=platform_get_drvdata(pdev);+structcpsw_priv*priv=netdev_priv(ndev);pm_runtime_get_sync(&pdev->dev);++/* Optionaly enable pins to be muxed in and configured */+if(!IS_ERR(priv->pins_default))+if(pinctrl_select_state(priv->pinctrl,priv->pins_default))+dev_err(dev,"could not set default pins\n");+if(netif_running(ndev))cpsw_ndo_open(ndev);return0;
From: Mugunthan V N <hidden> Date: 2013-05-21 09:54:59
Amend cpsw controller to optionally take a pin control handle and set
the state of the pins to:
- "default" on boot, resume
- "sleep" on suspend()
This should make it possible to optimize energy usage for the pins
for the suspend/resume cycle.
If any of the above pin states are missing in dt, a warning message
about the missing state is displayed.
If certain pin-states are not available, to remove this warning message
pass respective state name with null phandler.
Signed-off-by: Mugunthan V N <redacted>
---
drivers/net/ethernet/ti/davinci_mdio.c | 46 ++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
@@ -94,6 +95,11 @@ struct davinci_mdio_data {structmii_bus*bus;boolsuspended;unsignedlongaccess_time;/* jiffies */++/* Two optional pin states - default & sleep */+structpinctrl*pinctrl;+structpinctrl_state*pins_default;+structpinctrl_state*pins_sleep;};staticvoid__davinci_mdio_reset(structdavinci_mdio_data*data)
@@ -347,6 +353,36 @@ static int davinci_mdio_probe(struct platform_device *pdev)data->bus->parent=dev;data->bus->priv=data;+data->pinctrl=devm_pinctrl_get(&pdev->dev);+if(!IS_ERR(data->pinctrl)){+data->pins_default=pinctrl_lookup_state(data->pinctrl,+PINCTRL_STATE_DEFAULT);+/* enable pins to be muxed in and configured */+if(IS_ERR(data->pins_default))+dev_warn(&pdev->dev,"could not get default pinstate\n");+else+if(pinctrl_select_state(data->pinctrl,+data->pins_default))+dev_err(&pdev->dev,+"could not set default pins\n");++data->pins_sleep=pinctrl_lookup_state(data->pinctrl,+PINCTRL_STATE_SLEEP);+if(IS_ERR(data->pins_sleep))+dev_warn(&pdev->dev,"could not get sleep pinstate\n");+}else{+/*+*Sincewecontinueevenwhenpinctrlnodeisnotfound,+*Invalidatepinsasnotavailable.Thisistomakesurethat+*IS_ERR(pins_xxx)resultsinfailurewhenused.+*/+data->pins_default=ERR_PTR(-ENODATA);+data->pins_sleep=ERR_PTR(-ENODATA);++dev_warn(&pdev->dev,+"pins are not configured from the driver\n");+}+pm_runtime_enable(&pdev->dev);pm_runtime_get_sync(&pdev->dev);data->clk=clk_get(&pdev->dev,"fck");
@@ -454,6 +490,11 @@ static int davinci_mdio_suspend(struct device *dev)data->suspended=true;spin_unlock(&data->lock);+/* Optionally let pins go into sleep states */+if(!IS_ERR(data->pins_sleep))+if(pinctrl_select_state(data->pinctrl,data->pins_sleep))+dev_err(dev,"could not set pins to sleep state\n");+return0;}
@@ -465,6 +506,11 @@ static int davinci_mdio_resume(struct device *dev)spin_lock(&data->lock);pm_runtime_get_sync(data->dev);+/* Optionaly enable pins to be muxed in and configured */+if(!IS_ERR(data->pins_default))+if(pinctrl_select_state(data->pinctrl,data->pins_default))+dev_err(dev,"could not set default pins\n");+/* restart the scan state machine */ctrl=__raw_readl(&data->regs->control);ctrl|=CONTROL_ENABLE;
From: Mugunthan V N <hidden> Date: 2013-05-21 09:55:00
Add pinmux configurations for MII based CPSW ethernet to am335x-bone.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.
Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.
Todo:
- if an idle state is available for pins, add support for it.
Signed-off-by: Mugunthan V N <redacted>
---
arch/arm/boot/dts/am335x-bone.dts | 38 +++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
From: Mugunthan V N <hidden> Date: 2013-05-21 09:55:01
Add phy_id device tree data to am335x-evmsk device to bring up CPSW
ethernet present on am335x starter kit.
Signed-off-by: Mugunthan V N <redacted>
---
arch/arm/boot/dts/am335x-evmsk.dts | 8 ++++++++
1 file changed, 8 insertions(+)
From: Mugunthan V N <hidden> Date: 2013-05-21 09:55:02
Add pinmux configurations for MII based CPSW ethernet to AM335x EVMsk.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.
Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.
Todo:
- if an idle state is available for pins, add support for it.
Signed-off-by: Mugunthan V N <redacted>
---
arch/arm/boot/dts/am335x-evmsk.dts | 50 ++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
From: Mugunthan V N <hidden> Date: 2013-05-21 09:55:03
Add pinmux configurations for RGMII based CPSW ethernet to am335x-evm.
In this patch, only single named mode/state is added and these pins
are configured during pinctrl driver initialization.
Default mode is nothing but the values required for the module during
active state. With this configurations module is functional as
expected.
Todo:
- if an idle state is available for pins, add support for it.
Signed-off-by: Mugunthan V N <redacted>
---
arch/arm/boot/dts/am335x-evm.dts | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
This is not indented correctly.
Argument on the second, and subsequent, lines of a function call
must start at the first column after the openning parenthesis of
the function call itself.
Please audit for this problem in your entire patch series, fix
it up, and resubmit the full set of patches.
Thanks.
This is not indented correctly.
Argument on the second, and subsequent, lines of a function call
must start at the first column after the openning parenthesis of
the function call itself.
Please audit for this problem in your entire patch series, fix
it up, and resubmit the full set of patches.
Thanks.
Will fix it and submit the patch.
Regards
Mugunthan V N
This is not indented correctly.
Argument on the second, and subsequent, lines of a function call
must start at the first column after the openning parenthesis of
the function call itself.
Well, if I am correct, doing so will make the line cross 80 character limit.
If you could (please I ask), can you let me know how it can be handled in
above situation. I will make the changes/corrections and re-send it.
Thanks a lot in advance.
Please audit for this problem in your entire patch series, fix
it up, and resubmit the full set of patches.
Thanks.
This is not indented correctly.
Argument on the second, and subsequent, lines of a function call
must start at the first column after the openning parenthesis of
the function call itself.
Well, if I am correct, doing so will make the line cross 80 character limit.
If you could (please I ask), can you let me know how it can be handled in
above situation. I will make the changes/corrections and re-send it.
Thanks a lot in advance.
Avoid the deep indentation by coding the basic block into a helper
function.