lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 18 Nov 2012 16:52:49 -0800
From:	Anton Vorontsov <cbouatmailru@...il.com>
To:	Jenny TC <jenny.tc@...el.com>
Cc:	linux-kernel@...r.kernel.org,
	Pallala Ramakrishna <ramakrishna.pallala@...el.com>,
	Chanwoo Choi <cw00.choi@...sung.com>, myungjoo.ham@...sung.com
Subject: Re: [PATCH 3/7] power_supply : add supported charger cable  feature

On Thu, Oct 18, 2012 at 10:14:02PM +0530, Jenny TC wrote:
> 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@...el.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;

Enums have an integer resolution. Why do we need long type here?..

Thanks.

>  	size_t num_supplicants;
>  
>  	int (*get_property)(struct power_supply *psy,
> -- 
> 1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ