u8 val;
int err;
- ACPI_FUNCTION_TRACE("acpi_ec_smb_read");
-
err = ec_read(smbus->base + address, &val);
if (!err) {
*data = val;
{
int err;
- ACPI_FUNCTION_TRACE("acpi_ec_smb_write");
-
err = ec_write(smbus->base + address, data);
return (err);
}
unsigned char protocol, len = 0, pec, temp[2] = { 0, 0 };
int i;
- ACPI_FUNCTION_TRACE("acpi_ec_smb_access");
-
if (read_write == I2C_SMBUS_READ) {
protocol = ACPI_EC_SMB_PRTCL_READ;
} else {
static u32 acpi_ec_smb_func(struct i2c_adapter *adapter)
{
- ACPI_FUNCTION_TRACE("acpi_ec_smb_func");
return (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
struct acpi_ec_hc *ec_hc;
struct acpi_ec_smbus *smbus;
- ACPI_FUNCTION_TRACE("acpi_ec_hc_add");
-
if (!device) {
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
ec_hc = kmalloc(sizeof(struct acpi_ec_hc), GFP_KERNEL);
if (!ec_hc) {
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
memset(ec_hc, 0, sizeof(struct acpi_ec_hc));
smbus = kmalloc(sizeof(struct acpi_ec_smbus), GFP_KERNEL);
if (!smbus) {
kfree(ec_hc);
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
memset(smbus, 0, sizeof(struct acpi_ec_smbus));
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error obtaining _EC\n"));
kfree(ec_hc->smbus);
kfree(smbus);
- return_VALUE(-EIO);
+ return -EIO;
}
smbus->ec = acpi_driver_data(device->parent);
"EC SMBus adapter: Failed to register adapter\n"));
kfree(smbus);
kfree(ec_hc);
- return_VALUE(-EIO);
+ return -EIO;
}
ec_hc->smbus = smbus;
printk(KERN_INFO PREFIX "%s [%s]\n",
acpi_device_name(device), acpi_device_bid(device));
- return_VALUE(AE_OK);
+ return AE_OK;
}
static int acpi_ec_hc_remove(struct acpi_device *device, int type)
{
struct acpi_ec_hc *ec_hc;
- ACPI_FUNCTION_TRACE("acpi_ec_hc_remove");
-
if (!device) {
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
ec_hc = acpi_driver_data(device);
kfree(ec_hc->smbus);
kfree(ec_hc);
- return_VALUE(AE_OK);
+ return AE_OK;
}
static int __init acpi_ec_hc_init(void)
{
int result;
- ACPI_FUNCTION_TRACE("acpi_ec_hc_init");
result = acpi_bus_register_driver(&acpi_ec_hc_driver);
if (result < 0) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_ec_hc_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_ec_hc_exit");
acpi_bus_unregister_driver(&acpi_ec_hc_driver);
}
struct acpi_ec_hc *acpi_get_ec_hc(struct acpi_device *device)
{
- ACPI_FUNCTION_TRACE("acpi_get_ec_hc");
return ((struct acpi_ec_hc *)acpi_driver_data(device->parent));
}
char *err_str;
int err_number;
- ACPI_FUNCTION_TRACE("acpi_battery_smbus_err_handler");
-
data.word = 0;
result = smbus->adapter.algo->
int result = 0;
int i;
- ACPI_FUNCTION_TRACE("acpi_sbs_smbus_read_word");
-
if (err_handler == NULL) {
err_handler = acpi_battery_smbus_err_handler;
}
}
}
- return_VALUE(result);
+ return result;
}
static int
int result = 0;
int i;
- ACPI_FUNCTION_TRACE("acpi_sbs_smbus_read_str");
-
if (err_handler == NULL) {
err_handler = acpi_battery_smbus_err_handler;
}
}
}
- return_VALUE(result);
+ return result;
}
static int
int result = 0;
int i;
- ACPI_FUNCTION_TRACE("acpi_sbs_smbus_write_word");
-
if (err_handler == NULL) {
err_handler = acpi_battery_smbus_err_handler;
}
}
}
- return_VALUE(result);
+ return result;
}
/* --------------------------------------------------------------------------
char class_saved[20];
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_sbs_generate_event");
-
strcpy(bid_saved, acpi_device_bid(device));
strcpy(class_saved, acpi_device_class(device));
strcpy(acpi_device_bid(device), bid_saved);
strcpy(acpi_device_class(device), class_saved);
- return_VALUE(result);
+ return result;
}
static int acpi_battery_get_present(struct acpi_battery *battery)
int result = 0;
int is_present = 0;
- ACPI_FUNCTION_TRACE("acpi_battery_get_present");
-
result = acpi_sbs_smbus_read_word(battery->sbs->smbus,
ACPI_SBSM_SMBUS_ADDR, 0x01,
&state, NULL);
}
battery->battery_present = is_present;
- return_VALUE(result);
+ return result;
}
static int acpi_battery_is_present(struct acpi_battery *battery)
s16 state;
int foo;
- ACPI_FUNCTION_TRACE("acpi_battery_select");
-
if (battery->sbs->sbsm_present) {
/* Take special care not to knobble other nibbles of
}
end:
- return_VALUE(result);
+ return result;
}
static int acpi_sbsm_get_info(struct acpi_sbs *sbs)
int result = 0;
s16 battery_system_info;
- ACPI_FUNCTION_TRACE("acpi_sbsm_get_info");
-
result = acpi_sbs_smbus_read_word(smbus, ACPI_SBSM_SMBUS_ADDR, 0x04,
&battery_system_info, NULL);
if (result) {
end:
- return_VALUE(result);
+ return result;
}
static int acpi_battery_get_info(struct acpi_battery *battery)
s16 battery_mode;
s16 specification_info;
- ACPI_FUNCTION_TRACE("acpi_battery_get_info");
-
result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x03,
&battery_mode,
&acpi_battery_smbus_err_handler);
}
end:
- return_VALUE(result);
+ return result;
}
static void acpi_update_delay(struct acpi_sbs *sbs)
{
- ACPI_FUNCTION_TRACE("acpi_update_delay");
if (sbs->zombie) {
return;
}
struct acpi_ec_smbus *smbus = battery->sbs->smbus;
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_battery_get_state");
-
acpi_update_delay(battery->sbs);
result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x09,
&battery->state.voltage,
acpi_update_delay(battery->sbs);
end:
- return_VALUE(result);
+ return result;
}
static int acpi_battery_get_alarm(struct acpi_battery *battery)
struct acpi_ec_smbus *smbus = battery->sbs->smbus;
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_battery_get_alarm");
-
result = acpi_sbs_smbus_read_word(smbus, ACPI_SB_SMBUS_ADDR, 0x01,
&battery->alarm.remaining_capacity,
&acpi_battery_smbus_err_handler);
end:
- return_VALUE(result);
+ return result;
}
static int acpi_battery_set_alarm(struct acpi_battery *battery,
s16 battery_mode;
int foo;
- ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
-
result = acpi_battery_select(battery);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
end:
- return_VALUE(result);
+ return result;
}
static int acpi_battery_set_mode(struct acpi_battery *battery)
int result = 0;
s16 battery_mode;
- ACPI_FUNCTION_TRACE("acpi_battery_set_mode");
-
if (capacity_mode == DEF_CAPACITY_UNIT) {
goto end;
}
}
end:
- return_VALUE(result);
+ return result;
}
static int acpi_battery_init(struct acpi_battery *battery)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_battery_init");
-
result = acpi_battery_select(battery);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
}
end:
- return_VALUE(result);
+ return result;
}
static int acpi_ac_get_present(struct acpi_sbs *sbs)
int result = 0;
s16 charger_status;
- ACPI_FUNCTION_TRACE("acpi_ac_get_present");
-
result = acpi_sbs_smbus_read_word(smbus, ACPI_SBC_SMBUS_ADDR, 0x13,
&charger_status, NULL);
end:
- return_VALUE(result);
+ return result;
}
/* --------------------------------------------------------------------------
{
struct proc_dir_entry *entry = NULL;
- ACPI_FUNCTION_TRACE("acpi_sbs_generic_add_fs");
-
if (!*dir) {
*dir = proc_mkdir(dir_name, parent_dir);
if (!*dir) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"proc_mkdir() failed\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
(*dir)->owner = THIS_MODULE;
}
}
}
- return_VALUE(0);
+ return 0;
}
static void
acpi_sbs_generic_remove_fs(struct proc_dir_entry **dir,
struct proc_dir_entry *parent_dir)
{
- ACPI_FUNCTION_TRACE("acpi_sbs_generic_remove_fs");
if (*dir) {
remove_proc_entry(ACPI_SBS_FILE_INFO, *dir);
int cscale;
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_battery_read_info");
-
if (battery->sbs->zombie) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
down(&sbs_sem);
up(&sbs_sem);
- return_VALUE(result);
+ return result;
}
static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
int cscale;
int foo;
- ACPI_FUNCTION_TRACE("acpi_battery_read_state");
-
if (battery->sbs->zombie) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
down(&sbs_sem);
up(&sbs_sem);
- return_VALUE(result);
+ return result;
}
static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
int result = 0;
int cscale;
- ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
-
if (battery->sbs->zombie) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
down(&sbs_sem);
up(&sbs_sem);
- return_VALUE(result);
+ return result;
}
static ssize_t
char alarm_string[12] = { '\0' };
int result, old_alarm, new_alarm;
- ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
-
if (battery->sbs->zombie) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
down(&sbs_sem);
up(&sbs_sem);
if (result) {
- return_VALUE(result);
+ return result;
} else {
- return_VALUE(count);
+ return count;
}
}
struct acpi_sbs *sbs = (struct acpi_sbs *)seq->private;
int result;
- ACPI_FUNCTION_TRACE("acpi_ac_read_state");
-
if (sbs->zombie) {
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
down(&sbs_sem);
up(&sbs_sem);
- return_VALUE(0);
+ return 0;
}
static int acpi_ac_state_open_fs(struct inode *inode, struct file *file)
char dir_name[32];
struct acpi_battery *battery;
- ACPI_FUNCTION_TRACE("acpi_battery_add");
-
battery = &sbs->battery[id];
battery->alive = 0;
battery->alive = 1;
end:
- return_VALUE(result);
+ return result;
}
static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
{
- ACPI_FUNCTION_TRACE("acpi_battery_remove");
if (sbs->battery[id].battery_entry) {
acpi_sbs_generic_remove_fs(&(sbs->battery[id].battery_entry),
{
int result;
- ACPI_FUNCTION_TRACE("acpi_ac_add");
-
result = acpi_ac_get_present(sbs);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
end:
- return_VALUE(result);
+ return result;
}
static void acpi_ac_remove(struct acpi_sbs *sbs)
{
- ACPI_FUNCTION_TRACE("acpi_ac_remove");
if (sbs->ac_entry) {
acpi_sbs_generic_remove_fs(&sbs->ac_entry, acpi_ac_dir);
static void acpi_sbs_update_queue_run(unsigned long data)
{
- ACPI_FUNCTION_TRACE("acpi_sbs_update_queue_run");
acpi_os_execute(OSL_GPE_HANDLER, acpi_sbs_update_queue, (void *)data);
}
int do_battery_init, do_ac_init;
s16 old_remaining_capacity;
- ACPI_FUNCTION_TRACE("acpi_sbs_update_run");
-
if (sbs->zombie) {
goto end;
}
}
end:
- return_VALUE(result);
+ return result;
}
static void acpi_sbs_update_queue(void *data)
unsigned long delay = -1;
int result;
- ACPI_FUNCTION_TRACE("acpi_sbs_update_queue");
-
if (sbs->zombie) {
goto end;
}
int id, cnt;
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE("acpi_sbs_add");
-
sbs = kmalloc(sizeof(struct acpi_sbs), GFP_KERNEL);
if (!sbs) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "kmalloc() failed\n"));
- return_VALUE(-ENOMEM);
+ return -ENOMEM;
}
memset(sbs, 0, sizeof(struct acpi_sbs));
}
}
- return_VALUE(result);
+ return result;
}
int acpi_sbs_remove(struct acpi_device *device, int type)
struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device);
int id;
- ACPI_FUNCTION_TRACE("acpi_sbs_remove");
-
if (!device || !sbs) {
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
sbs->zombie = 1;
kfree(sbs);
- return_VALUE(0);
+ return 0;
}
static int __init acpi_sbs_init(void)
{
int result = 0;
- ACPI_FUNCTION_TRACE("acpi_sbs_init");
-
init_MUTEX(&sbs_sem);
if (capacity_mode != DEF_CAPACITY_UNIT
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "acpi_sbs_init: "
"invalid capacity_mode = %d\n",
capacity_mode));
- return_VALUE(-EINVAL);
+ return -EINVAL;
}
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"acpi_lock_ac_dir() failed\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
acpi_battery_dir = acpi_lock_battery_dir();
if (!acpi_battery_dir) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"acpi_lock_battery_dir() failed\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
result = acpi_bus_register_driver(&acpi_sbs_driver);
if (result < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"acpi_bus_register_driver() failed\n"));
- return_VALUE(-ENODEV);
+ return -ENODEV;
}
- return_VALUE(0);
+ return 0;
}
static void __exit acpi_sbs_exit(void)
{
- ACPI_FUNCTION_TRACE("acpi_sbs_exit");
acpi_bus_unregister_driver(&acpi_sbs_driver);
acpi_unlock_battery_dir(acpi_battery_dir);
acpi_battery_dir = NULL;
- return_VOID;
+ return;
}
module_init(acpi_sbs_init);