blob: 695c390e28843953b437effeb098f1d72323fefd [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Alexey Starikovskiy91087df2007-09-26 19:43:28 +04002struct acpi_smb_hc;
3enum acpi_smb_protocol {
4 SMBUS_WRITE_QUICK = 2,
5 SMBUS_READ_QUICK = 3,
6 SMBUS_SEND_BYTE = 4,
7 SMBUS_RECEIVE_BYTE = 5,
8 SMBUS_WRITE_BYTE = 6,
9 SMBUS_READ_BYTE = 7,
10 SMBUS_WRITE_WORD = 8,
11 SMBUS_READ_WORD = 9,
12 SMBUS_WRITE_BLOCK = 0xa,
13 SMBUS_READ_BLOCK = 0xb,
14 SMBUS_PROCESS_CALL = 0xc,
15 SMBUS_BLOCK_PROCESS_CALL = 0xd,
16};
17
Alexey Starikovskiyc2d00f22007-12-08 13:02:40 +030018enum acpi_sbs_device_addr {
19 ACPI_SBS_CHARGER = 0x9,
20 ACPI_SBS_MANAGER = 0xa,
21 ACPI_SBS_BATTERY = 0xb,
22};
23
Alexey Starikovskiy91087df2007-09-26 19:43:28 +040024typedef void (*smbus_alarm_callback)(void *context);
25
26extern int acpi_smbus_read(struct acpi_smb_hc *hc, u8 protocol, u8 address,
Maximilian Luzc6237b22020-11-05 03:06:00 +010027 u8 command, u8 *data);
Alexey Starikovskiy91087df2007-09-26 19:43:28 +040028extern int acpi_smbus_write(struct acpi_smb_hc *hc, u8 protocol, u8 slave_address,
Maximilian Luzc6237b22020-11-05 03:06:00 +010029 u8 command, u8 *data, u8 length);
Alexey Starikovskiy91087df2007-09-26 19:43:28 +040030extern int acpi_smbus_register_callback(struct acpi_smb_hc *hc,
Maximilian Luzc6237b22020-11-05 03:06:00 +010031 smbus_alarm_callback callback, void *context);
Alexey Starikovskiy91087df2007-09-26 19:43:28 +040032extern int acpi_smbus_unregister_callback(struct acpi_smb_hc *hc);