Commit f36cc6cd authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-video', 'acpi-x86', 'acpi-tools' and 'acpi-docs'

Merge a new ACPI backlight quirk, new ACPI quirks for I2C device
enumeration on some platforms, a pfrut utility fix and an ACPI
documentation fix for 6.3-rc3:

 - Add backlight=native DMI quirk for Dell Vostro 15 3535 to the ACPI
   video driver (Chia-Lin Kao).

 - Add ACPI quirks for I2C devices enumeration on Lenovo Yoga Book X90
   and Acer Iconia One 7 B1-750 (Hans de Goede).

 - Fix handling of invalid command line option values in the ACPI pfrut
   utility (Chen Yu).

 - Fix references to I2C device data type in the ACPI documentation for
   device enumeration (Andy Shevchenko).

* acpi-video:
  ACPI: video: Add backlight=native DMI quirk for Dell Vostro 15 3535

* acpi-x86:
  ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Book X90
  ACPI: x86: Add skip i2c clients quirk for Acer Iconia One 7 B1-750
  ACPI: x86: Introduce an acpi_quirk_skip_gpio_event_handlers() helper

* acpi-tools:
  ACPI: tools: pfrut: Check if the input of level and type is in the right numeric range

* acpi-docs:
  ACPI: docs: enumeration: Correct reference to the I²C device data type
...@@ -19,7 +19,7 @@ possible we decided to do following: ...@@ -19,7 +19,7 @@ possible we decided to do following:
platform devices. platform devices.
- Devices behind real busses where there is a connector resource - Devices behind real busses where there is a connector resource
are represented as struct spi_device or struct i2c_device. Note are represented as struct spi_device or struct i2c_client. Note
that standard UARTs are not busses so there is no struct uart_device, that standard UARTs are not busses so there is no struct uart_device,
although some of them may be represented by struct serdev_device. although some of them may be represented by struct serdev_device.
......
...@@ -716,6 +716,13 @@ static const struct dmi_system_id video_detect_dmi_table[] = { ...@@ -716,6 +716,13 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"), DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
}, },
}, },
{
.callback = video_detect_force_native,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 15 3535"),
},
},
/* /*
* Desktops which falsely report a backlight and which our heuristics * Desktops which falsely report a backlight and which our heuristics
......
...@@ -251,6 +251,7 @@ bool force_storage_d3(void) ...@@ -251,6 +251,7 @@ bool force_storage_d3(void)
#define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(1) #define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(1)
#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(2) #define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(2)
#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(3) #define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(3)
#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(4)
static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
/* /*
...@@ -279,6 +280,16 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { ...@@ -279,6 +280,16 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
* need the x86-android-tablets module to properly work. * need the x86-android-tablets module to properly work.
*/ */
#if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS) #if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS)
{
/* Acer Iconia One 7 B1-750 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
DMI_MATCH(DMI_PRODUCT_NAME, "VESPA2"),
},
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
},
{ {
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
...@@ -286,7 +297,19 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { ...@@ -286,7 +297,19 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
}, },
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_UART1_TTY_UART2_SKIP | ACPI_QUIRK_UART1_TTY_UART2_SKIP |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
},
{
/* Lenovo Yoga Book X90F/L */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
},
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
}, },
{ {
.matches = { .matches = {
...@@ -294,7 +317,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { ...@@ -294,7 +317,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"), DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
}, },
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
}, },
{ {
/* Lenovo Yoga Tablet 2 1050F/L */ /* Lenovo Yoga Tablet 2 1050F/L */
...@@ -336,7 +360,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { ...@@ -336,7 +360,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"), DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
}, },
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY), ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
}, },
{ {
/* Whitelabel (sold as various brands) TM800A550L */ /* Whitelabel (sold as various brands) TM800A550L */
...@@ -413,6 +438,20 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s ...@@ -413,6 +438,20 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration); EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration);
bool acpi_quirk_skip_gpio_event_handlers(void)
{
const struct dmi_system_id *dmi_id;
long quirks;
dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
if (!dmi_id)
return false;
quirks = (unsigned long)dmi_id->driver_data;
return (quirks & ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS);
}
EXPORT_SYMBOL_GPL(acpi_quirk_skip_gpio_event_handlers);
#endif #endif
/* Lists of PMIC ACPI HIDs with an (often better) native charger driver */ /* Lists of PMIC ACPI HIDs with an (often better) native charger driver */
......
...@@ -536,6 +536,9 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) ...@@ -536,6 +536,9 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip)
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return; return;
if (acpi_quirk_skip_gpio_event_handlers())
return;
acpi_walk_resources(handle, METHOD_NAME__AEI, acpi_walk_resources(handle, METHOD_NAME__AEI,
acpi_gpiochip_alloc_event, acpi_gpio); acpi_gpiochip_alloc_event, acpi_gpio);
......
...@@ -657,6 +657,7 @@ static inline bool acpi_quirk_skip_acpi_ac_and_battery(void) ...@@ -657,6 +657,7 @@ static inline bool acpi_quirk_skip_acpi_ac_and_battery(void)
#if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS) #if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS)
bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev); bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev);
int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip); int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip);
bool acpi_quirk_skip_gpio_event_handlers(void);
#else #else
static inline bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev) static inline bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev)
{ {
...@@ -668,6 +669,10 @@ acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip) ...@@ -668,6 +669,10 @@ acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
*skip = false; *skip = false;
return 0; return 0;
} }
static inline bool acpi_quirk_skip_gpio_event_handlers(void)
{
return false;
}
#endif #endif
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -97,7 +97,7 @@ static struct option long_options[] = { ...@@ -97,7 +97,7 @@ static struct option long_options[] = {
static void parse_options(int argc, char **argv) static void parse_options(int argc, char **argv)
{ {
int option_index = 0; int option_index = 0;
char *pathname; char *pathname, *endptr;
int opt; int opt;
pathname = strdup(argv[0]); pathname = strdup(argv[0]);
...@@ -125,11 +125,23 @@ static void parse_options(int argc, char **argv) ...@@ -125,11 +125,23 @@ static void parse_options(int argc, char **argv)
log_getinfo = 1; log_getinfo = 1;
break; break;
case 'T': case 'T':
log_type = atoi(optarg); log_type = strtol(optarg, &endptr, 0);
if (*endptr || (log_type != 0 && log_type != 1)) {
printf("Number expected: type(0:execution, 1:history) - Quit.\n");
exit(1);
}
set_log_type = 1; set_log_type = 1;
break; break;
case 'L': case 'L':
log_level = atoi(optarg); log_level = strtol(optarg, &endptr, 0);
if (*endptr ||
(log_level != 0 && log_level != 1 &&
log_level != 2 && log_level != 4)) {
printf("Number expected: level(0, 1, 2, 4) - Quit.\n");
exit(1);
}
set_log_level = 1; set_log_level = 1;
break; break;
case 'R': case 'R':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment