mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jenny TC <jenny.tc@intel.com>
To: Anton Vorontsov <anton.vorontsov@linaro.org>,
	Anton Vorontsov <cbouatmailru@gmail.com>,
	linux-kernel@vger.kernel.org
Cc: Pallala Ramakrishna <ramakrishna.pallala@intel.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	myungjoo.ham@samsung.com, Jenny TC <jenny.tc@intel.com>
Subject: [PATCH 3/7] power_supply : add supported charger cable  feature
Date: Thu, 18 Oct 2012 22:14:02 +0530	[thread overview]
Message-ID: <1350578646-3315-4-git-send-email-jenny.tc@intel.com> (raw)
In-Reply-To: <1350578646-3315-1-git-send-email-jenny.tc@intel.com>

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

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

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 7c06956..eea1709 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -163,6 +163,21 @@ enum power_supply_type {
 	POWER_SUPPLY_TYPE_USB_ACA,	/* Accessory Charger Adapters */
 };
 
+enum power_supply_charger_cable_type {
+	POWER_SUPPLY_CHARGER_TYPE_NONE = 0,
+	POWER_SUPPLY_CHARGER_TYPE_USB_SDP = 1 << 0,
+	POWER_SUPPLY_CHARGER_TYPE_USB_DCP = 1 << 1,
+	POWER_SUPPLY_CHARGER_TYPE_USB_CDP = 1 << 2,
+	POWER_SUPPLY_CHARGER_TYPE_USB_ACA = 1 << 3,
+	POWER_SUPPLY_CHARGER_TYPE_AC = 1 << 4,
+};
+
+#define POWER_SUPPLY_CHARGER_TYPE_USB \
+	(POWER_SUPPLY_CHARGER_TYPE_USB_SDP | \
+	POWER_SUPPLY_CHARGER_TYPE_USB_DCP | \
+	POWER_SUPPLY_CHARGER_TYPE_USB_CDP | \
+	POWER_SUPPLY_CHARGER_TYPE_USB_ACA)
+
 union power_supply_propval {
 	int intval;
 	const char *strval;
@@ -175,6 +190,7 @@ struct power_supply {
 	size_t num_properties;
 
 	char **supplied_to;
+	unsigned long supported_cables;
 	size_t num_supplicants;
 
 	int (*get_property)(struct power_supply *psy,
-- 
1.7.9.5


  parent reply	other threads:[~2012-10-18 11:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18 16:43 [PATCH 0/7] power_supply: Introduce charging Framework Jenny TC
2012-10-18 16:44 ` [PATCH 1/7] power_supply : Introduce battery identification framework Jenny TC
2012-10-18 16:44 ` [PATCH 2/7] power_supply: Add charger control properties Jenny TC
2012-11-19  0:50   ` Anton Vorontsov
2012-10-18 16:44 ` Jenny TC [this message]
2012-11-19  0:52   ` [PATCH 3/7] power_supply : add supported charger cable feature Anton Vorontsov
2012-10-18 16:44 ` [PATCH 4/7] power_supply: add throttle state Jenny TC
2012-11-19  2:39   ` Anton Vorontsov
2012-10-18 16:44 ` [PATCH 5/7] power_supply: Introduce Power Supply charging framework Jenny TC
2012-11-19  2:39   ` Anton Vorontsov
2012-10-18 16:44 ` [PATCH 6/7] power_supply: enable charger framework callbacks Jenny TC
2012-10-18 16:44 ` [PATCH 7/7] power_supply: Introduce PSE compliant algorithm Jenny TC

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=1350578646-3315-4-git-send-email-jenny.tc@intel.com \
    --to=jenny.tc@intel.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=cbouatmailru@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=ramakrishna.pallala@intel.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®