* [RFC PATCH 0/3] Remove some dummy set_power callbacks
@ 2017-01-18 12:19 Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 1/3] usb: phy: ab8500: Remove the set_power callback Baolin Wang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Baolin Wang @ 2017-01-18 12:19 UTC (permalink / raw)
To: balbi, gregkh
Cc: linux-usb, linux-kernel, linaro-kernel, broonie, baolin.wang
In future we plan to introduce USB charger to set PMIC current drawn from
USB configuration, instead of using set_power callback in phy driver. Moreover
in these 3 phy drivers, the set_power callback did not implement anything
to set PMIC current, thus we should remove them.
Baolin Wang (3):
usb: phy: ab8500: Remove the set_power callback
usb: phy: msm: Remove the set_power callback
usb: phy: fsl: Remove the set_power callback
drivers/usb/phy/phy-ab8500-usb.c | 20 --------------------
drivers/usb/phy/phy-fsl-usb.c | 12 ------------
drivers/usb/phy/phy-msm-usb.c | 18 ------------------
3 files changed, 50 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 1/3] usb: phy: ab8500: Remove the set_power callback
2017-01-18 12:19 [RFC PATCH 0/3] Remove some dummy set_power callbacks Baolin Wang
@ 2017-01-18 12:19 ` Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 2/3] usb: phy: msm: " Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 3/3] usb: phy: fsl: " Baolin Wang
2 siblings, 0 replies; 4+ messages in thread
From: Baolin Wang @ 2017-01-18 12:19 UTC (permalink / raw)
To: balbi, gregkh
Cc: linux-usb, linux-kernel, linaro-kernel, broonie, baolin.wang
There are no users will use the vbus_draw variable set by set_power()
callback to set the vbus current. Thus we can remove it.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/usb/phy/phy-ab8500-usb.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index a03caf4..3dfbb97 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -1036,25 +1036,6 @@ static unsigned ab8500_eyediagram_workaroud(struct ab8500_usb *ab, unsigned mA)
return mA;
}
-static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
-{
- struct ab8500_usb *ab;
-
- if (!phy)
- return -ENODEV;
-
- ab = phy_to_ab(phy);
-
- mA = ab8500_eyediagram_workaroud(ab, mA);
-
- ab->vbus_draw = mA;
-
- atomic_notifier_call_chain(&ab->phy.notifier,
- UX500_MUSB_VBUS, &ab->vbus_draw);
-
- return 0;
-}
-
static int ab8500_usb_set_suspend(struct usb_phy *x, int suspend)
{
/* TODO */
@@ -1392,7 +1373,6 @@ static int ab8500_usb_probe(struct platform_device *pdev)
ab->phy.otg = otg;
ab->phy.label = "ab8500";
ab->phy.set_suspend = ab8500_usb_set_suspend;
- ab->phy.set_power = ab8500_usb_set_power;
ab->phy.otg->state = OTG_STATE_UNDEFINED;
otg->usb_phy = &ab->phy;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH 2/3] usb: phy: msm: Remove the set_power callback
2017-01-18 12:19 [RFC PATCH 0/3] Remove some dummy set_power callbacks Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 1/3] usb: phy: ab8500: Remove the set_power callback Baolin Wang
@ 2017-01-18 12:19 ` Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 3/3] usb: phy: fsl: " Baolin Wang
2 siblings, 0 replies; 4+ messages in thread
From: Baolin Wang @ 2017-01-18 12:19 UTC (permalink / raw)
To: balbi, gregkh
Cc: linux-usb, linux-kernel, linaro-kernel, broonie, baolin.wang
Since it will not set the PMIC current drawn from USB configuration by
set_power callback, then remove it.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/usb/phy/phy-msm-usb.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 8a34759..9e52890 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -842,23 +842,6 @@ static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA)
motg->cur_power = mA;
}
-static int msm_otg_set_power(struct usb_phy *phy, unsigned mA)
-{
- struct msm_otg *motg = container_of(phy, struct msm_otg, phy);
-
- /*
- * Gadget driver uses set_power method to notify about the
- * available current based on suspend/configured states.
- *
- * IDEV_CHG can be drawn irrespective of suspend/un-configured
- * states when CDP/ACA is connected.
- */
- if (motg->chg_type == USB_SDP_CHARGER)
- msm_otg_notify_charger(motg, mA);
-
- return 0;
-}
-
static void msm_otg_start_host(struct usb_phy *phy, int on)
{
struct msm_otg *motg = container_of(phy, struct msm_otg, phy);
@@ -1950,7 +1933,6 @@ static int msm_otg_probe(struct platform_device *pdev)
}
phy->init = msm_phy_init;
- phy->set_power = msm_otg_set_power;
phy->notify_disconnect = msm_phy_notify_disconnect;
phy->type = USB_PHY_TYPE_USB2;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH 3/3] usb: phy: fsl: Remove the set_power callback
2017-01-18 12:19 [RFC PATCH 0/3] Remove some dummy set_power callbacks Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 1/3] usb: phy: ab8500: Remove the set_power callback Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 2/3] usb: phy: msm: " Baolin Wang
@ 2017-01-18 12:19 ` Baolin Wang
2 siblings, 0 replies; 4+ messages in thread
From: Baolin Wang @ 2017-01-18 12:19 UTC (permalink / raw)
To: balbi, gregkh
Cc: linux-usb, linux-kernel, linaro-kernel, broonie, baolin.wang
Since the set_power callback did not do anything for power setting,
then remove it.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/usb/phy/phy-fsl-usb.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 94eb292..392ab42 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -642,17 +642,6 @@ static int fsl_otg_set_peripheral(struct usb_otg *otg,
return 0;
}
-/* Set OTG port power, only for B-device */
-static int fsl_otg_set_power(struct usb_phy *phy, unsigned mA)
-{
- if (!fsl_otg_dev)
- return -ENODEV;
- if (phy->otg->state == OTG_STATE_B_PERIPHERAL)
- pr_info("FSL OTG: Draw %d mA\n", mA);
-
- return 0;
-}
-
/*
* Delayed pin detect interrupt processing.
*
@@ -821,7 +810,6 @@ static int fsl_otg_conf(struct platform_device *pdev)
/* initialize the otg structure */
fsl_otg_tc->phy.label = DRIVER_DESC;
fsl_otg_tc->phy.dev = &pdev->dev;
- fsl_otg_tc->phy.set_power = fsl_otg_set_power;
fsl_otg_tc->phy.otg->usb_phy = &fsl_otg_tc->phy;
fsl_otg_tc->phy.otg->set_host = fsl_otg_set_host;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-18 12:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 12:19 [RFC PATCH 0/3] Remove some dummy set_power callbacks Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 1/3] usb: phy: ab8500: Remove the set_power callback Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 2/3] usb: phy: msm: " Baolin Wang
2017-01-18 12:19 ` [RFC PATCH 3/3] usb: phy: fsl: " Baolin Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).