All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] asus-wmi: Disable acpi-video backlight on desktop machi
@ 2014-07-08  8:47 Hans de Goede
  2014-07-08  8:47 ` [PATCH v2 1/2] asus-wmi: Disable acpi-video backlight on desktop machines Hans de Goede
  2014-07-08  8:47 ` [PATCH v2 2/2] asus-wmi: backlight_init: Stop treating -ENODEV as if its not an error Hans de Goede
  0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2014-07-08  8:47 UTC (permalink / raw)
  To: Matthew Garrett, Corentin Chary; +Cc: platform-driver-x86, acpi4asus-user

Hi All,

Here is v2 of my patch series to stop certain asus desktop motherboards
registering a backlight interface for a non-existent backlight.

Changes since v1:
-Simply stop acpi-video from registering a backlight interface on all boards
 with a dmi-chassis-type of desktop rather then using a dmi-product-name based
 blacklist
-Add a patch to make the asus-wmi not register its own backlight interface
 despite the BIOS having no support for it

Regards,

Hans

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 1/2] asus-wmi: Disable acpi-video backlight on desktop machines
  2014-07-08  8:47 [PATCH v2 0/2] asus-wmi: Disable acpi-video backlight on desktop machi Hans de Goede
@ 2014-07-08  8:47 ` Hans de Goede
  2014-07-08  8:47 ` [PATCH v2 2/2] asus-wmi: backlight_init: Stop treating -ENODEV as if its not an error Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2014-07-08  8:47 UTC (permalink / raw)
  To: Matthew Garrett, Corentin Chary
  Cc: platform-driver-x86, acpi4asus-user, Hans de Goede

Some Asus motherboards for desktop PC-s export an acpi-video interface
advertising backlight support. Test the dmi chassis-type and tell acpi-video
to not register a backlight interface on desktops.

https://bugzilla.redhat.com/show_bug.cgi?id=1097436

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/asus-wmi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 3c6cced..70aec19 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -46,6 +46,7 @@
 #include <linux/platform_device.h>
 #include <linux/thermal.h>
 #include <linux/acpi.h>
+#include <linux/dmi.h>
 #include <acpi/video.h>
 
 #include "asus-wmi.h"
@@ -1734,6 +1735,7 @@ static int asus_wmi_add(struct platform_device *pdev)
 	struct platform_driver *pdrv = to_platform_driver(pdev->dev.driver);
 	struct asus_wmi_driver *wdrv = to_asus_wmi_driver(pdrv);
 	struct asus_wmi *asus;
+	const char *chassis_type;
 	acpi_status status;
 	int err;
 	u32 result;
@@ -1770,6 +1772,11 @@ static int asus_wmi_add(struct platform_device *pdev)
 	if (err)
 		goto fail_rfkill;
 
+	/* Some Asus desktop boards export an acpi-video backlight interface,
+	   stop this from showing up */
+	chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
+	if (chassis_type && !strcmp(chassis_type, "3"))
+		acpi_video_dmi_promote_vendor();
 	if (asus->driver->quirks->wmi_backlight_power)
 		acpi_video_dmi_promote_vendor();
 	if (!acpi_video_backlight_support()) {
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] asus-wmi: backlight_init: Stop treating -ENODEV as if its not an error
  2014-07-08  8:47 [PATCH v2 0/2] asus-wmi: Disable acpi-video backlight on desktop machi Hans de Goede
  2014-07-08  8:47 ` [PATCH v2 1/2] asus-wmi: Disable acpi-video backlight on desktop machines Hans de Goede
@ 2014-07-08  8:47 ` Hans de Goede
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2014-07-08  8:47 UTC (permalink / raw)
  To: Matthew Garrett, Corentin Chary
  Cc: platform-driver-x86, acpi4asus-user, Hans de Goede

When bl_power support got added to asus-wmi, the error handling for it was
written to ignore -ENODEV, to avoid not registering a backlight interface for
models which have no bl_power control, but do have brightness control.

At the same time the error handling for brightness_max was modified to do the
same, this is wrong, when there is no brightness_max asus-wmi should not
register a backlight interface.

Note the caller of asus_wmi_backlight_init already special cases -ENODEV,
and will not cause the wmi driver regristration to fail because of a
-ENODEV return from asus_wmi_backlight_init.

https://bugzilla.redhat.com/show_bug.cgi?id=1097436

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/asus-wmi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 70aec19..8a88416 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1271,10 +1271,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
 	int power;
 
 	max = read_brightness_max(asus);
-
-	if (max == -ENODEV)
-		max = 0;
-	else if (max < 0)
+	if (max < 0)
 		return max;
 
 	power = read_backlight_power(asus);
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-08  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08  8:47 [PATCH v2 0/2] asus-wmi: Disable acpi-video backlight on desktop machi Hans de Goede
2014-07-08  8:47 ` [PATCH v2 1/2] asus-wmi: Disable acpi-video backlight on desktop machines Hans de Goede
2014-07-08  8:47 ` [PATCH v2 2/2] asus-wmi: backlight_init: Stop treating -ENODEV as if its not an error Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.