lkml.org 
[lkml]   [2012]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] extcon : callback function to read cable property
Date
For some cables a boolean variable will not be enough to represent
the state and properties of the cable. For example a charger cable can
have states CONNECT,DISCOONECT,SUSPEND(Host suspend for SDP cable),
RESUME(Host wakeup), and UPDATE (to increase the charge
current after USB enumaeration).Also the properties of the cable may
vary based on the state. FOr example in SUSPENDED state platforms can
support 0/100/500/950(USB 3.0) mA based on the HW. To initiate charging
the consumer should be able to get the charger properties dynamically.

Signed-off-by: Jenny TC <jenny.tc@intel.com>
---
include/linux/extcon.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 073fd49..2e61ee0 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -122,6 +122,7 @@ struct extcon_dev {
/* --- Optional callbacks to override class functions --- */
ssize_t (*print_name)(struct extcon_dev *edev, char *buf);
ssize_t (*print_state)(struct extcon_dev *edev, char *buf);
+ int (*get_cable_properties)(const char *cable_name, void *cable_props);

/* --- Internal data. Please do not set. --- */
struct device *dev;
@@ -177,6 +178,19 @@ struct extcon_specific_cable_nb {
unsigned long previous_value;
};

+enum extcon_chrgr_cbl_stat {
+ EXTCON_CHRGR_CABLE_CONNECTED,
+ EXTCON_CHRGR_CABLE_DISCONNECTED,
+ EXTCON_CHRGR_CABLE_SUSPENDED,
+ EXTCON_CHRGR_CABLE_RESUMED,
+ EXTCON_CHRGR_CABLE_UPDATED,
+};
+
+struct extcon_chrgr_cbl_props {
+ enum extcon_chrgr_cbl_stat cable_stat;
+ unsigned long mA;
+};
+
#if IS_ENABLED(CONFIG_EXTCON)

/*
--
1.7.9.5


\
 
 \ /
  Last update: 2012-10-10 07:21    [W:0.500 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site