aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-06-14 20:42:42 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-07 06:56:11 -0400
commitdd43de20f540179863d9d7c3188b6a6cfde9a731 (patch)
treec4d63c67016ea6e4565563f3bda882141271b6e5 /drivers/acpi/ec.c
parent4a3f6b5bf3f3293087a5f60ea3328715fe14b6de (diff)
ACPI / EC: Add detailed fields debugging support of EC_SC(R).
Developers really don't need to translate EC_SC(R) in mind as long as the field details are decoded in the debugging message. Tested-by: Gareth Williams <gareth@garethwilliams.me.uk> Tested-by: Steffen Weber <steffen.weber@gmail.com> Tested-by: Hans de Goede <jwrdegoede@fedoraproject.org> Tested-by: Arthur Chen <axchen@nvidia.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index f8fb736e38df..ff16132e5c52 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -55,6 +55,7 @@
55/* EC status register */ 55/* EC status register */
56#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ 56#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
57#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ 57#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */
58#define ACPI_EC_FLAG_CMD 0x08 /* Input buffer contains a command */
58#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */ 59#define ACPI_EC_FLAG_BURST 0x10 /* burst mode */
59#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ 60#define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */
60 61
@@ -133,26 +134,33 @@ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
133static inline u8 acpi_ec_read_status(struct acpi_ec *ec) 134static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
134{ 135{
135 u8 x = inb(ec->command_addr); 136 u8 x = inb(ec->command_addr);
136 pr_debug("---> status = 0x%2.2x\n", x); 137 pr_debug("EC_SC(R) = 0x%2.2x "
138 "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n",
139 x,
140 !!(x & ACPI_EC_FLAG_SCI),
141 !!(x & ACPI_EC_FLAG_BURST),
142 !!(x & ACPI_EC_FLAG_CMD),
143 !!(x & ACPI_EC_FLAG_IBF),
144 !!(x & ACPI_EC_FLAG_OBF));
137 return x; 145 return x;
138} 146}
139 147
140static inline u8 acpi_ec_read_data(struct acpi_ec *ec) 148static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
141{ 149{
142 u8 x = inb(ec->data_addr); 150 u8 x = inb(ec->data_addr);
143 pr_debug("---> data = 0x%2.2x\n", x); 151 pr_debug("EC_DATA(R) = 0x%2.2x\n", x);
144 return x; 152 return x;
145} 153}
146 154
147static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command) 155static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
148{ 156{
149 pr_debug("<--- command = 0x%2.2x\n", command); 157 pr_debug("EC_SC(W) = 0x%2.2x\n", command);
150 outb(command, ec->command_addr); 158 outb(command, ec->command_addr);
151} 159}
152 160
153static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) 161static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
154{ 162{
155 pr_debug("<--- data = 0x%2.2x\n", data); 163 pr_debug("EC_DATA(W) = 0x%2.2x\n", data);
156 outb(data, ec->data_addr); 164 outb(data, ec->data_addr);
157} 165}
158 166