From: Jenny TC <jenny.tc@intel.com>
To: myungjoo.ham@samsung.com, cw00.choi@samsung.com,
linux-kernel@vger.kernel.org
Cc: jenny.tc@intel.com
Subject: [PATCH] extcon : callback function to read cable property
Date: Wed, 10 Oct 2012 15:53:48 +0530 [thread overview]
Message-ID: <1349864628-21479-1-git-send-email-jenny.tc@intel.com> (raw)
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
next reply other threads:[~2012-10-10 4:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 10:23 Jenny TC [this message]
2012-10-10 14:45 ` anish kumar
2012-10-11 1:20 ` Tc, Jenny
2012-10-11 13:47 ` anish kumar
2012-10-17 6:34 ` Tc, Jenny
2012-11-08 1:25 ` Chanwoo Choi
2012-11-09 14:05 ` Tc, Jenny
2012-11-10 4:18 ` anish kumar
2012-11-15 4:05 ` Tc, Jenny
2012-11-15 19:31 ` anish singh
2012-11-20 1:39 ` Tc, Jenny
2012-11-20 2:29 ` Chanwoo Choi
2012-11-20 2:42 ` Tc, Jenny
2012-11-20 6:10 ` Chanwoo Choi
2012-11-20 9:14 ` Tc, Jenny
2012-11-20 9:24 ` Anton Vorontsov
2012-11-20 9:32 ` anish singh
2012-11-20 11:08 ` Tc, Jenny
2012-11-20 11:21 ` Anton Vorontsov
2012-10-17 7:08 MyungJoo Ham
2012-10-19 3:13 ` Tc, Jenny
2012-10-20 1:40 ` Chanwoo Choi
2012-10-25 3:18 ` Tc, Jenny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1349864628-21479-1-git-send-email-jenny.tc@intel.com \
--to=jenny.tc@intel.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®