[adm5120] add USB drivers for the NFS-101U/WU profiles
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1084-contrib-fix-chgstate-array-bloat.patch.patch
1 From 293025ae0e971da194ecb58be304835f246b6c9e Mon Sep 17 00:00:00 2001
2 From: Mike Montour <mail@mmontour.net>
3 Date: Sun, 13 Apr 2008 07:25:47 +0100
4 Subject: [PATCH] contrib-fix-chgstate-array-bloat.patch
5
6 --- linux-2.6.22/drivers/i2c/chips/pcf50606.c.orig 2008-01-17 22:30:16.000000000 -0800
7 +++ linux-2.6.22/drivers/i2c/chips/pcf50606.c 2008-01-17 22:31:43.000000000 -0800
8 @@ -71,12 +71,19 @@
9
10 I2C_CLIENT_INSMOD_1(pcf50606);
11
12 -#define PCF50606_F_CHG_FAST 0x00000001 /* Charger Fast allowed */
13 -#define PCF50606_F_CHG_PRESENT 0x00000002 /* Charger present */
14 -#define PCF50606_F_CHG_FOK 0x00000004 /* Fast OK for battery */
15 -#define PCF50606_F_CHG_ERR 0x00000008 /* Charger Error */
16 -#define PCF50606_F_CHG_PROT 0x00000010 /* Charger Protection */
17 -#define PCF50606_F_CHG_READY 0x00000020 /* Charging completed */
18 +#define PCF50606_B_CHG_FAST 0 /* Charger Fast allowed */
19 +#define PCF50606_B_CHG_PRESENT 1 /* Charger present */
20 +#define PCF50606_B_CHG_FOK 2 /* Fast OK for battery */
21 +#define PCF50606_B_CHG_ERR 3 /* Charger Error */
22 +#define PCF50606_B_CHG_PROT 4 /* Charger Protection */
23 +#define PCF50606_B_CHG_READY 5 /* Charging completed */
24 +
25 +#define PCF50606_F_CHG_FAST (1<<PCF50606_B_CHG_FAST) /* Charger Fast allowed */
26 +#define PCF50606_F_CHG_PRESENT (1<<PCF50606_B_CHG_PRESENT) /* Charger present */
27 +#define PCF50606_F_CHG_FOK (1<<PCF50606_B_CHG_FOK) /* Fast OK for battery */
28 +#define PCF50606_F_CHG_ERR (1<<PCF50606_B_CHG_ERR) /* Charger Error */
29 +#define PCF50606_F_CHG_PROT (1<<PCF50606_B_CHG_PROT) /* Charger Protection */
30 +#define PCF50606_F_CHG_READY (1<<PCF50606_B_CHG_READY) /* Charging completed */
31 #define PCF50606_F_CHG_MASK 0x000000fc
32
33 #define PCF50606_F_PWR_PRESSED 0x00000100
34 @@ -1026,12 +1033,12 @@
35 static DEVICE_ATTR(chgmode, S_IRUGO | S_IWUSR, show_chgmode, set_chgmode);
36
37 static const char *chgstate_names[] = {
38 - [PCF50606_F_CHG_FAST] = "fast_enabled",
39 - [PCF50606_F_CHG_PRESENT] = "present",
40 - [PCF50606_F_CHG_FOK] = "fast_ok",
41 - [PCF50606_F_CHG_ERR] = "error",
42 - [PCF50606_F_CHG_PROT] = "protection",
43 - [PCF50606_F_CHG_READY] = "ready",
44 + [PCF50606_B_CHG_FAST] = "fast_enabled",
45 + [PCF50606_B_CHG_PRESENT] = "present",
46 + [PCF50606_B_CHG_FOK] = "fast_ok",
47 + [PCF50606_B_CHG_ERR] = "error",
48 + [PCF50606_B_CHG_PROT] = "protection",
49 + [PCF50606_B_CHG_READY] = "ready",
50 };
51
52 static ssize_t show_chgstate(struct device *dev, struct device_attribute *attr,
53 ---
54 drivers/i2c/chips/pcf50606.c | 31 +++++++++++++++++++------------
55 1 files changed, 19 insertions(+), 12 deletions(-)
56
57 diff --git a/drivers/i2c/chips/pcf50606.c b/drivers/i2c/chips/pcf50606.c
58 index a1c92d3..aaec6e8 100644
59 --- a/drivers/i2c/chips/pcf50606.c
60 +++ b/drivers/i2c/chips/pcf50606.c
61 @@ -72,12 +72,19 @@ static unsigned short normal_i2c[] = { 0x08, I2C_CLIENT_END };
62
63 I2C_CLIENT_INSMOD_1(pcf50606);
64
65 -#define PCF50606_F_CHG_FAST 0x00000001 /* Charger Fast allowed */
66 -#define PCF50606_F_CHG_PRESENT 0x00000002 /* Charger present */
67 -#define PCF50606_F_CHG_FOK 0x00000004 /* Fast OK for battery */
68 -#define PCF50606_F_CHG_ERR 0x00000008 /* Charger Error */
69 -#define PCF50606_F_CHG_PROT 0x00000010 /* Charger Protection */
70 -#define PCF50606_F_CHG_READY 0x00000020 /* Charging completed */
71 +#define PCF50606_B_CHG_FAST 0 /* Charger Fast allowed */
72 +#define PCF50606_B_CHG_PRESENT 1 /* Charger present */
73 +#define PCF50606_B_CHG_FOK 2 /* Fast OK for battery */
74 +#define PCF50606_B_CHG_ERR 3 /* Charger Error */
75 +#define PCF50606_B_CHG_PROT 4 /* Charger Protection */
76 +#define PCF50606_B_CHG_READY 5 /* Charging completed */
77 +
78 +#define PCF50606_F_CHG_FAST (1<<PCF50606_B_CHG_FAST) /* Charger Fast allowed */
79 +#define PCF50606_F_CHG_PRESENT (1<<PCF50606_B_CHG_PRESENT) /* Charger present */
80 +#define PCF50606_F_CHG_FOK (1<<PCF50606_B_CHG_FOK) /* Fast OK for battery */
81 +#define PCF50606_F_CHG_ERR (1<<PCF50606_B_CHG_ERR) /* Charger Error */
82 +#define PCF50606_F_CHG_PROT (1<<PCF50606_B_CHG_PROT) /* Charger Protection */
83 +#define PCF50606_F_CHG_READY (1<<PCF50606_B_CHG_READY) /* Charging completed */
84 #define PCF50606_F_CHG_MASK 0x000000fc
85
86 #define PCF50606_F_PWR_PRESSED 0x00000100
87 @@ -1087,12 +1094,12 @@ static ssize_t set_chgmode(struct device *dev, struct device_attribute *attr,
88 static DEVICE_ATTR(chgmode, S_IRUGO | S_IWUSR, show_chgmode, set_chgmode);
89
90 static const char *chgstate_names[] = {
91 - [PCF50606_F_CHG_FAST] = "fast_enabled",
92 - [PCF50606_F_CHG_PRESENT] = "present",
93 - [PCF50606_F_CHG_FOK] = "fast_ok",
94 - [PCF50606_F_CHG_ERR] = "error",
95 - [PCF50606_F_CHG_PROT] = "protection",
96 - [PCF50606_F_CHG_READY] = "ready",
97 + [PCF50606_B_CHG_FAST] = "fast_enabled",
98 + [PCF50606_B_CHG_PRESENT] = "present",
99 + [PCF50606_B_CHG_FOK] = "fast_ok",
100 + [PCF50606_B_CHG_ERR] = "error",
101 + [PCF50606_B_CHG_PROT] = "protection",
102 + [PCF50606_B_CHG_READY] = "ready",
103 };
104
105 static ssize_t show_chgstate(struct device *dev, struct device_attribute *attr,
106 --
107 1.5.6.5
108
This page took 0.04755 seconds and 5 git commands to generate.