]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
usb: gadget: tegra: Maxim 14675 driver support
authorPhilip Rakity <prakity@nvidia.com>
Tue, 11 Feb 2014 16:14:34 +0000 (16:14 +0000)
committerMandar Padmawar <mpadmawar@nvidia.com>
Tue, 3 Jun 2014 14:36:34 +0000 (07:36 -0700)
Support Maxim 14765 detection

bug 1321188
bug 1456402

(cherry picked from commit a3bdc86bf2a5192d55a26375a9480f415ab9c7dd)
Change-Id: I8802b4f35493c99f770f68bef797177268eb6300
Reviewed-on: http://git-master/r/400491
Signed-off-by: Philip Rakity <prakity@nvidia.com>
Reviewed-on: http://git-master/r/417036
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
drivers/usb/gadget/tegra_udc.c
drivers/usb/gadget/tegra_udc.h

index c60276aa79941071347b1314baf1c5b55fa61146..a890d1e11cfddb4c51c99e6d49e9b9be1b7055cd 100644 (file)
@@ -133,6 +133,7 @@ static char *const tegra_udc_extcon_cable[] = {
        [CONNECT_TYPE_SDP] = "USB",
        [CONNECT_TYPE_DCP] = "TA",
        [CONNECT_TYPE_DCP_QC2] = "QC2",
+       [CONNECT_TYPE_DCP_MAXIM] = "MAXIM",
        [CONNECT_TYPE_CDP] = "Charge-downstream",
        [CONNECT_TYPE_NV_CHARGER] = "Fast-charger",
        [CONNECT_TYPE_NON_STANDARD_CHARGER] = "Slow-charger",
@@ -1417,6 +1418,11 @@ static int tegra_usb_set_charging_current(struct tegra_udc *udc)
                max_ua = udc->qc2_current_limit;
                tegra_udc_notify_event(udc, USB_EVENT_CHARGER);
                break;
+       case CONNECT_TYPE_DCP_MAXIM:
+               dev_info(dev, "connected to Maxim(wall charger)\n");
+               max_ua = udc->dcp_current_limit;
+               tegra_udc_notify_event(udc, USB_EVENT_CHARGER);
+               break;
        case CONNECT_TYPE_CDP:
                dev_info(dev, "connected to CDP(1.5A)\n");
                /*
@@ -1488,6 +1494,9 @@ static int tegra_detect_cable_type(struct tegra_udc *udc)
        if (tegra_usb_phy_charger_detected(udc->phy)) {
                if (tegra_usb_phy_cdp_charger_detected(udc->phy))
                        tegra_udc_set_charger_type(udc, CONNECT_TYPE_CDP);
+               else if (tegra_usb_phy_maxim_charger_detected(udc->phy))
+                       tegra_udc_set_charger_type(udc,
+                                               CONNECT_TYPE_DCP_MAXIM);
                else if (udc->qc2_voltage) {
                        /* Must be DCP -- figure out if Quick Charge 2 or DCP.
                         * Initially set low current since QC2 will reset to
@@ -1579,7 +1588,8 @@ static int tegra_vbus_session(struct usb_gadget *gadget, int is_active)
                tegra_detect_cable_type(udc);
                /* start the controller if USB host detected */
                if ((udc->connect_type == CONNECT_TYPE_SDP) ||
-                   (udc->connect_type == CONNECT_TYPE_CDP))
+                   (udc->connect_type == CONNECT_TYPE_CDP) ||
+                   (udc->connect_type == CONNECT_TYPE_DCP_MAXIM))
                        dr_controller_run(udc);
        }
        mutex_unlock(&udc->sync_lock);
index fe1f5bb7505ec9c17ae9f0cbe5b4f5514e66a08e..a7fe163785ff51bf26571a0c17b88ab148ae8f37 100644 (file)
@@ -418,6 +418,7 @@ enum tegra_connect_type {
        CONNECT_TYPE_NONE,
        CONNECT_TYPE_SDP,
        CONNECT_TYPE_DCP,
+       CONNECT_TYPE_DCP_MAXIM,
        CONNECT_TYPE_DCP_QC2,
        CONNECT_TYPE_CDP,
        CONNECT_TYPE_NV_CHARGER,