static int atlas_acpi_button_remove(struct acpi_device *device, int type)
{
	acpi_status status;

	status = acpi_remove_address_space_handler(device->handle,
				0x81, &acpi_atlas_button_handler);
	if (ACPI_FAILURE(status))
		pr_err("error removing addr spc handler\n");

	input_unregister_device(input_dev);

	return 0;
}
Exemple #2
0
static int atlas_acpi_button_remove(struct acpi_device *device, int type)
{
    acpi_status status;

    status = acpi_remove_address_space_handler(device->handle,
                0x81, &acpi_atlas_button_handler);
    if (ACPI_FAILURE(status)) {
        printk(KERN_ERR "Atlas: Error removing addr spc handler\n");
        status = -EINVAL;
    }

    input_unregister_device(input_dev);

    return status;
}
Exemple #3
0
acpi_status
ec_remove_space_handler (
	EC_CONTEXT              *ec)
{
	acpi_status             status = AE_OK;

	FUNCTION_TRACE("ec_remove_space_handler");

	if (!ec) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	status = acpi_remove_address_space_handler(ec->acpi_handle,
		ACPI_ADR_SPACE_EC, &ec_space_handler);

	return_ACPI_STATUS(status);
}
void acpi_i2c_remove_space_handler(struct i2c_adapter *adapter)
{
	acpi_handle handle = ACPI_HANDLE(adapter->dev.parent);
	struct acpi_i2c_handler_data *data;
	acpi_status status;

	if (!handle)
		return;

	acpi_remove_address_space_handler(handle,
				ACPI_ADR_SPACE_GSBUS,
				&acpi_i2c_space_handler);

	status = acpi_bus_get_private_data(handle, (void **)&data);
	if (ACPI_SUCCESS(status))
		kfree(data);

	acpi_bus_detach_private_data(handle);
}
Exemple #5
0
static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev)
{
	if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle,
			ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler)))
		pr_err(PREFIX "Error removing CMOS-RTC region handler\n");
}
Exemple #6
0
int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle,
                                        struct regmap *regmap,
                                        struct intel_pmic_opregion_data *d)
{
    acpi_status status;
    struct intel_pmic_opregion *opregion;
    int ret;

    if (!dev || !regmap || !d)
        return -EINVAL;

    if (!handle)
        return -ENODEV;

    opregion = devm_kzalloc(dev, sizeof(*opregion), GFP_KERNEL);
    if (!opregion)
        return -ENOMEM;

    mutex_init(&opregion->lock);
    opregion->regmap = regmap;
    opregion->lpat_table = acpi_lpat_get_conversion_table(handle);

    status = acpi_install_address_space_handler(handle,
             PMIC_POWER_OPREGION_ID,
             intel_pmic_power_handler,
             NULL, opregion);
    if (ACPI_FAILURE(status)) {
        ret = -ENODEV;
        goto out_error;
    }

    status = acpi_install_address_space_handler(handle,
             PMIC_THERMAL_OPREGION_ID,
             intel_pmic_thermal_handler,
             NULL, opregion);
    if (ACPI_FAILURE(status)) {
        acpi_remove_address_space_handler(handle, PMIC_POWER_OPREGION_ID,
                                          intel_pmic_power_handler);
        ret = -ENODEV;
        goto out_remove_power_handler;
    }

    status = acpi_install_address_space_handler(handle,
             PMIC_REGS_OPREGION_ID, intel_pmic_regs_handler, NULL,
             opregion);
    if (ACPI_FAILURE(status)) {
        ret = -ENODEV;
        goto out_remove_thermal_handler;
    }

    opregion->data = d;
    return 0;

out_remove_thermal_handler:
    acpi_remove_address_space_handler(handle, PMIC_THERMAL_OPREGION_ID,
                                      intel_pmic_thermal_handler);

out_remove_power_handler:
    acpi_remove_address_space_handler(handle, PMIC_POWER_OPREGION_ID,
                                      intel_pmic_power_handler);

out_error:
    acpi_lpat_free_conversion_table(opregion->lpat_table);
    return ret;
}