summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLi Jun <jun.li@freescale.com>2015-06-20 15:39:09 +0800
committerLi Jun <jun.li@freescale.com>2015-07-22 10:22:13 +0800
commitd19577e09d011c53e54bee0b97863b49b216aac9 (patch)
tree9eb5d426cbe40b9493d9fc20e506351b2a22d44f /drivers
parent420c8b1558b034107f741495fd7a19eab5b4976e (diff)
MLK-11123-18 usb: chipidea: otg: remove hnp_enable input
Since we use dt property hnp_support to decide if HNP is enabled, so remove hnp_enable input file. Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit 51b7dca391128f35cfd46bc921c2d0175c60335b)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/chipidea/ci.h2
-rw-r--r--drivers/usb/chipidea/otg_fsm.c60
2 files changed, 2 insertions, 60 deletions
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index b1a33919840e..880283d31c5c 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -204,7 +204,6 @@ struct hw_bank {
* @in_lpm: if the core in low power mode
* @wakeup_int: if wakeup interrupt occur
* @rev: The revision number for controller
- * @hnp_enable: indicates if OTG full HNP is enabled
* @adp_probe_event: indicates to enable adp probe
* @adp_sense_event: indicates to enable adp sense
*/
@@ -271,7 +270,6 @@ struct ci_hdrc {
u32 pm_portsc;
u32 pm_usbmode;
struct work_struct power_lost_work;
- bool hnp_enable;
bool adp_probe_event;
bool adp_sense_event;
};
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index f9c685bd462a..39eb323552cd 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -148,12 +148,6 @@ set_b_bus_req(struct device *dev, struct device_attribute *attr,
if (count > 2)
return -1;
- if (!ci->hnp_enable) {
- dev_warn(ci->dev,
- "Can't do this because HNP is not enabled!\n");
- return -1;
- }
-
mutex_lock(&ci->fsm.lock);
if (buf[0] == '0')
ci->fsm.b_bus_req = 0;
@@ -193,57 +187,11 @@ set_a_clr_err(struct device *dev, struct device_attribute *attr,
}
static DEVICE_ATTR(a_clr_err, S_IWUSR, NULL, set_a_clr_err);
-static ssize_t
-get_hnp_enable(struct device *dev, struct device_attribute *attr, char *buf)
-{
- char *next;
- unsigned size, t;
- struct ci_hdrc *ci = dev_get_drvdata(dev);
-
- next = buf;
- size = PAGE_SIZE;
- t = scnprintf(next, size, "%d\n", ci->hnp_enable);
- size -= t;
- next += t;
-
- return PAGE_SIZE - size;
-}
-
-static ssize_t
-set_hnp_enable(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct ci_hdrc *ci = dev_get_drvdata(dev);
- unsigned long flags;
-
- if (count > 2)
- return -1;
-
- spin_lock_irqsave(&ci->lock, flags);
- if (buf[0] == '1') {
- ci->hnp_enable = 1;
- } else if (buf[0] == '0') {
- if ((ci->fsm.otg->state == OTG_STATE_B_WAIT_ACON) ||
- (ci->fsm.otg->state == OTG_STATE_B_HOST) ||
- (ci->fsm.otg->state == OTG_STATE_A_PERIPHERAL))
- dev_warn(ci->dev,
- "Can't disable HNP while role switch!\n");
- else
- ci->hnp_enable = 0;
- }
- spin_unlock_irqrestore(&ci->lock, flags);
-
- return count;
-}
-static DEVICE_ATTR(hnp_enable, S_IRUGO | S_IWUSR, get_hnp_enable,
- set_hnp_enable);
-
static struct attribute *inputs_attrs[] = {
&dev_attr_a_bus_req.attr,
&dev_attr_a_bus_drop.attr,
&dev_attr_b_bus_req.attr,
&dev_attr_a_clr_err.attr,
- &dev_attr_hnp_enable.attr,
NULL,
};
@@ -604,9 +552,6 @@ static void ci_otg_fsm_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer t)
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
if (t < NUM_OTG_FSM_TIMERS) {
- if ((!ci->hnp_enable) && ((t == HNP_POLLING) ||
- (t == A_WAIT_BCON)))
- return;
if (t == HNP_POLLING)
ci_otg_add_hnp_polling_timer(ci);
else
@@ -744,7 +689,7 @@ static void ci_otg_start_adp_prb(struct otg_fsm *fsm)
{
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
- if (!ci->platdata->ci_otg_caps.adp_support || !ci->hnp_enable)
+ if (!ci->platdata->ci_otg_caps.adp_support)
return;
if (ci->platdata->notify_event)
@@ -757,8 +702,7 @@ static void ci_otg_start_adp_sns(struct otg_fsm *fsm)
{
struct ci_hdrc *ci = container_of(fsm, struct ci_hdrc, fsm);
- if (!ci->platdata->ci_otg_caps.adp_support ||
- !ci->hnp_enable || !ci->driver)
+ if (!ci->platdata->ci_otg_caps.adp_support || !ci->driver)
return;
/* TODO If power_up and vbus is off, do one ADP probe before SRP */