]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
include: usb: add include files for QC2
authorPhilip Rakity <prakity@nvidia.com>
Wed, 29 Jan 2014 11:00:46 +0000 (11:00 +0000)
committerJuha Tukkinen <jtukkinen@nvidia.com>
Thu, 13 Feb 2014 11:22:40 +0000 (03:22 -0800)
Add support for Quick Charge 2 charger.
Charger support 5V, 9V, 12V and 20V charging.

Bug 1424733

Change-Id: Iad0c8d0394a1d091655611e9d2ebeef7f51c15c9
Reviewed-on: http://git-master/r/361517
(cherry picked from commit 606a0b2282f2c702609078f38def8c39c784623a)
Signed-off-by: Philip Rakity <prakity@nvidia.com>
Reviewed-on: http://git-master/r/363210
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Jay Cheng <jacheng@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
include/linux/platform_data/tegra_usb.h
include/linux/usb/tegra_usb_phy.h

index 93c93fcf4ba848db6c2cfcccf4d623b4368dfff2..838c56dc88fe059edb9eff2d74f7ff1e668d17bd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Google, Inc.
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -45,6 +45,31 @@ enum tegra_usb_id_detection {
        TEGRA_USB_VIRTUAL_ID = 3,
 };
 
+/**
+ *
+ * Set the maximum voltage that can be supplied
+ * over USB vbus that the board supports if we use
+ * a quick charge 2 wall charger.
+ * a low value means longer charge time
+ * a too high value will blow up the board.
+ * if not sure what board supports use 5V.
+ * Allowed values:
+ *     TEGRA_USB_QC2_5V
+ *     TEGRA_USB_QC2_9V
+ *     TEGRA_USB_QC2_12V
+ *     TEGRA_USB_QC2_20V (probably not safe)
+ *
+ * specify the maximum current that the internal charger
+ * can draw from an external wall charger
+ */
+enum tegra_usb_qc2_voltage {
+       TEGRA_USB_QC2_5V = 0,
+       TEGRA_USB_QC2_9V = 1,
+       TEGRA_USB_QC2_12V = 2,
+       TEGRA_USB_QC2_20V = 3,
+};
+
+
 /**
  * configuration structure for setting up utmi phy
  */
@@ -103,6 +128,7 @@ struct tegra_usb_dev_mode_data {
        int vbus_pmu_irq;
        int vbus_gpio;
        int dcp_current_limit_ma;
+       int qc2_current_limit_ma;
        bool charging_supported;
        bool remote_wakeup_supported;
        bool is_xhci;
@@ -132,6 +158,7 @@ struct tegra_usb_platform_data {
        enum tegra_usb_id_detection id_det_type;
        enum tegra_usb_phy_interface phy_intf;
        enum tegra_usb_operation_mode op_mode;
+       enum tegra_usb_qc2_voltage qc2_voltage;
 
        union {
                struct tegra_usb_dev_mode_data dev;
index cdab5a1b261156af7463e8560f7212a49e4d2096..affb6de3912fbba769c1422589eeb563e0fd07ef 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2010 Google, Inc.
- * Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2011-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -94,6 +94,14 @@ bool tegra_usb_phy_hw_accessible(struct tegra_usb_phy *phy);
  */
 bool tegra_usb_phy_charger_detected(struct tegra_usb_phy *phy);
 
+/**
+ * Indicates whether qc2 charger is connected or not
+ * if QuickCharge 2 DCP returns true
+ * if standard CDP/DCP returns false
+ */
+bool tegra_usb_phy_qc2_charger_detected(struct tegra_usb_phy *phy,
+               int max_voltage);
+
 /**
  * Indicates whether nvidia proprietary charger is connected or not
  * if nvidia proprietary charger is detected then returns true else false