From: Jenny TC <jenny.tc@intel.com>
To: linux-kernel@vger.kernel.org,
Anton Vorontsov <cbouatmailru@gmail.com>,
Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Jenny TC <jenny.tc@intel.com>
Subject: [PATCH 2/7] power_supply : add charger cable properties
Date: Mon, 23 Sep 2013 23:34:00 +0530 [thread overview]
Message-ID: <1379959445-28207-3-git-send-email-jenny.tc@intel.com> (raw)
In-Reply-To: <1379959445-28207-1-git-send-email-jenny.tc@intel.com>
Since the charger cables are related to power supply subsystem it
makes sense to define the properties associate with charger cables.
The properties include cable events and the input current. The cable
properties may come from different sources. Since they are associated
with power_supply subsystem, it make sense to unify the properties
in the power supply susbsyem layer.
Also a charger can support different types of charger sources (cables).
It make sense to define a field to inform the power supply subsystem
what kind of cable a charger driver supports. Since a bitmask would
be the easy way to do define, it's good to have a enum which has
the bitmask definition for each cable types
Change-Id: Ia655c0924b7a5a845121342aa8f5d3840cccfbc4
Signed-off-by: Jenny TC <jenny.tc@intel.com>
---
include/linux/power_supply.h | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index ddeab05..c3ce514a 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -166,6 +166,43 @@ enum power_supply_type {
POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
};
+enum psy_charger_cable_event {
+ PSY_CHARGER_CABLE_EVENT_CONNECT = 0,
+ PSY_CHARGER_CABLE_EVENT_UPDATE,
+ PSY_CHARGER_CABLE_EVENT_RESUME,
+ PSY_CHARGER_CABLE_EVENT_SUSPEND,
+ PSY_CHARGER_CABLE_EVENT_DISCONNECT,
+};
+
+enum psy_charger_cable_type {
+ PSY_CHARGER_CABLE_TYPE_NONE = 0,
+ PSY_CHARGER_CABLE_TYPE_USB_SDP = 1 << 0,
+ PSY_CHARGER_CABLE_TYPE_USB_DCP = 1 << 1,
+ PSY_CHARGER_CABLE_TYPE_USB_CDP = 1 << 2,
+ PSY_CHARGER_CABLE_TYPE_USB_ACA = 1 << 3,
+ PSY_CHARGER_CABLE_TYPE_AC = 1 << 4,
+ PSY_CHARGER_CABLE_TYPE_ACA_DOCK = 1 << 5,
+ PSY_CHARGER_CABLE_TYPE_ACA_A = 1 << 6,
+ PSY_CHARGER_CABLE_TYPE_ACA_B = 1 << 7,
+ PSY_CHARGER_CABLE_TYPE_ACA_C = 1 << 8,
+ PSY_CHARGER_CABLE_TYPE_SE1 = 1 << 9,
+ PSY_CHARGER_CABLE_TYPE_MHL = 1 << 10,
+ PSY_CHARGER_CABLE_TYPE_B_DEVICE = 1 << 11,
+};
+
+struct psy_cable_props {
+ enum psy_charger_cable_event chrg_evt;
+ enum psy_charger_cable_type chrg_type;
+ unsigned int mA; /* input current limit */
+};
+
+#define PSY_CHARGER_CABLE_TYPE_USB \
+ (PSY_CHARGER_CABLE_TYPE_USB_SDP | \
+ PSY_CHARGER_CABLE_TYPE_USB_DCP | \
+ PSY_CHARGER_CABLE_TYPE_USB_CDP | \
+ PSY_CHARGER_CABLE_TYPE_USB_ACA | \
+ PSY_CHARGER_CABLE_TYPE_ACA_DOCK)
+
union power_supply_propval {
int intval;
const char *strval;
@@ -181,6 +218,7 @@ struct power_supply {
char **supplied_to;
size_t num_supplicants;
+ unsigned long supported_cables;
char **supplied_from;
size_t num_supplies;
--
1.7.9.5
next prev parent reply other threads:[~2013-09-23 10:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-23 18:03 [PATCH 0/7] power_supply: Introduce Power Supply Charging Framework Jenny TC
2013-09-23 18:03 ` [PATCH 1/7] power_supply: Add charger control properties Jenny TC
2013-10-27 23:46 ` Anton Vorontsov
2013-10-28 3:36 ` Tc, Jenny
2013-10-28 6:18 ` Anton Vorontsov
2013-10-29 4:57 ` NeilBrown
2013-09-23 18:04 ` Jenny TC [this message]
2013-09-23 18:04 ` [PATCH 3/7] power_supply: add throttle state Jenny TC
2013-09-23 18:04 ` [PATCH 4/7] power_supply: Add power_supply notifier Jenny TC
2013-09-23 18:04 ` [PATCH 5/7] power_supply : Introduce battery identification framework Jenny TC
2013-09-23 18:04 ` [PATCH 6/7] power_supply: Introduce Power Supply charging framework Jenny TC
2013-09-23 18:04 ` [PATCH 7/7] power_supply: Introduce PSE compliant algorithm Jenny TC
2013-10-28 6:17 ` Anton Vorontsov
2013-10-25 16:49 ` [PATCH 0/7] power_supply: Introduce Power Supply Charging Framework 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=1379959445-28207-3-git-send-email-jenny.tc@intel.com \
--to=jenny.tc@intel.com \
--cc=anton.vorontsov@linaro.org \
--cc=cbouatmailru@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome