All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e
@ 2014-08-18  6:09 Edward Lin
  2014-08-21 23:35 ` Karol Babioch
  0 siblings, 1 reply; 5+ messages in thread
From: Edward Lin @ 2014-08-18  6:09 UTC (permalink / raw)
  To: ike.pan, matthew.garrett, platform-driver-x86; +Cc: yk

ACPI video is not functional on Lenovo B470e.
The brightness control is also broken with vendor mode.
The brightness control only works with intel_backlight.

So, blacklist this machine for unregistering ACPI video driver and
not using vendor backlight driver.

Signed-off-by: Edward Lin <yidi.lin@canonical.com>
---
 drivers/platform/x86/ideapad-laptop.c |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index fc468a3..6ee7c20 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -38,6 +38,7 @@
 #include <linux/i8042.h>
 #include <linux/dmi.h>
 #include <linux/device.h>
+#include <acpi/video.h>
 
 #define IDEAPAD_RFKILL_DEV_NUM	(3)
 
@@ -89,6 +90,7 @@ struct ideapad_private {
 	unsigned long cfg;
 	bool has_hw_rfkill_switch;
 	bool has_touchpad_control;
+	bool has_broken_backlight;
 };
 
 static bool no_bt_rfkill;
@@ -866,6 +868,17 @@ static struct dmi_system_id no_touchpad_ctrl_list[] = {
 	{}
 };
 
+static struct dmi_system_id broken_backlight_list[] = {
+	{
+	 .ident = "Lenovo B470e",
+	 .matches = {
+		DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo B470e"),
+		},
+	},
+	{},
+};
+
 static int ideapad_acpi_add(struct platform_device *pdev)
 {
 	int ret, i;
@@ -890,6 +903,7 @@ static int ideapad_acpi_add(struct platform_device *pdev)
 	priv->platform_device = pdev;
 	priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list);
 	priv->has_touchpad_control = !dmi_check_system(no_touchpad_ctrl_list);
+	priv->has_broken_backlight = dmi_check_system(broken_backlight_list);
 
 	ret = ideapad_sysfs_init(priv);
 	if (ret)
@@ -917,10 +931,18 @@ static int ideapad_acpi_add(struct platform_device *pdev)
 	ideapad_sync_rfk_state(priv);
 	ideapad_sync_touchpad_state(priv);
 
+	if (priv->has_broken_backlight)
+		acpi_video_dmi_promote_vendor();
+
 	if (!acpi_video_backlight_support()) {
-		ret = ideapad_backlight_init(priv);
-		if (ret && ret != -ENODEV)
-			goto backlight_failed;
+		pr_info("Disabling ACPI video driver\n");
+		acpi_video_unregister();
+
+		if (!priv->has_broken_backlight) {
+			ret = ideapad_backlight_init(priv);
+			if (ret && ret != -ENODEV)
+				goto backlight_failed;
+		}
 	}
 	ret = acpi_install_notify_handler(adev->handle,
 		ACPI_DEVICE_NOTIFY, ideapad_acpi_notify, priv);
-- 
1.7.9.5

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

* Re: [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e
  2014-08-18  6:09 [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e Edward Lin
@ 2014-08-21 23:35 ` Karol Babioch
  2014-08-22  6:18   ` Yidi Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Karol Babioch @ 2014-08-21 23:35 UTC (permalink / raw)
  To: Edward Lin, platform-driver-x86; +Cc: mattia Dongili

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

Hi Edward Lin,

Am 18.08.2014 um 08:09 schrieb Edward Lin:
> ACPI video is not functional on Lenovo B470e.
> The brightness control is also broken with vendor mode.
> The brightness control only works with intel_backlight.

By looking at your description (and your patch) I'm wondering how
exactly this problem made itself apparent? I'm having a similar (the
same?) issue with my Sony Vaio VPCS12C5E. The backlight interface
registered by ACPI does not work and I have to boot with the command
line option "acpi_backlight=vendor". Even then two interfaces get
registered "nv_backlight" and "sony", only one of which (nv_backlight)
works.

Desktop environments (GNOME in particular) seem to be confused by this,
so I always have to change the brightness by writing directly into the
"actual_brightness" file. I've reported this back in 2012 [1], but was
told that it is an ACPI issue and so it never was fixed.

Couldn't a similar patch be applied to the sony-laptop module? I've
added Mattia Dongili to the discussion, hopefully he doesn't mind to
take a look at this again. I'm glad to test any patches, but am not
familiar enough with all of the internal structs to mess around with
them for myself without breaking support for other users of this module,
especially since my model was shipped with in two different versions:
One with the internal Intel GPU and another with a dedicated Nvidia GPU.
I'm afraid a simple DMI match might not be good enough in this case?

Best regards,
Karol Babioch

[1]: http://www.spinics.net/lists/platform-driver-x86/msg03406.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e
  2014-08-21 23:35 ` Karol Babioch
@ 2014-08-22  6:18   ` Yidi Lin
  2015-01-19  3:14     ` AceLan Kao
  0 siblings, 1 reply; 5+ messages in thread
From: Yidi Lin @ 2014-08-22  6:18 UTC (permalink / raw)
  To: Karol Babioch; +Cc: platform-driver-x86, mattia Dongili, YK

Hi Karol Babioch,

On Fri, Aug 22, 2014 at 7:35 AM, Karol Babioch <karol@babioch.de> wrote:
> By looking at your description (and your patch) I'm wondering how
> exactly this problem made itself apparent? I'm having a similar (the
> same?) issue with my Sony Vaio VPCS12C5E. The backlight interface
> registered by ACPI does not work and I have to boot with the command
> line option "acpi_backlight=vendor". Even then two interfaces get
> registered "nv_backlight" and "sony", only one of which (nv_backlight)
> works.
>

My situation is that the brightness control on Lenovo B470e is broken on
Ubuntu 12.04.5 but 12.04.2. Neither "acpi_backlight=vendor " nor
"video.use_native_backlight=1" works for the brightness control.

After bisecting, the regression happens in 3.10-rc1.

Before 3.10-rc1, acpi/video.c fails to register backlight interface due to
acpi_video_device_lcd_set_level() returns -EINVAL in
acpi_video_init_brightness().
Only "intel_backlight" is registered under /sys/class/backlight.
So the brightness can be adjusted from UI.

In 3.10-rc1, some changes make acpi/video.c able to register backlight
for Lenovo B470e. "acpi_video0" is used as the default backlight interface.

There is no BIOS update since 2012. And the vendor is unlikely to fix this bug.
So I propose the patch for fixing the brightness control on Lenovo B470e.

> Desktop environments (GNOME in particular) seem to be confused by this,
> so I always have to change the brightness by writing directly into the
> "actual_brightness" file. I've reported this back in 2012 [1], but was
> told that it is an ACPI issue and so it never was fixed.
>

Similar situation on Toshiba T130-15T
https://bugzilla.kernel.org/show_bug.cgi?id=50551

> Couldn't a similar patch be applied to the sony-laptop module? I've
> added Mattia Dongili to the discussion, hopefully he doesn't mind to
> take a look at this again. I'm glad to test any patches, but am not
> familiar enough with all of the internal structs to mess around with
> them for myself without breaking support for other users of this module,
> especially since my model was shipped with in two different versions:
> One with the internal Intel GPU and another with a dedicated Nvidia GPU.
> I'm afraid a simple DMI match might not be good enough in this case?
>

You may use dmidecode to see if there is any extra information which can
differentiate between these two versions.

Regards,
Edward Lin

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

* Re: [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e
  2014-08-22  6:18   ` Yidi Lin
@ 2015-01-19  3:14     ` AceLan Kao
  2015-01-27  2:56       ` Darren Hart
  0 siblings, 1 reply; 5+ messages in thread
From: AceLan Kao @ 2015-01-19  3:14 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: Karol Babioch, mattia Dongili, YK, Darren Hart

Hi all,

I'm wondering are there any concerns that prevent this patch from
entering the upstream?

Best regards,
AceLan Kao.

2014-08-22 14:18 GMT+08:00 Yidi Lin <yidi.lin@canonical.com>:
> Hi Karol Babioch,
>
> On Fri, Aug 22, 2014 at 7:35 AM, Karol Babioch <karol@babioch.de> wrote:
>> By looking at your description (and your patch) I'm wondering how
>> exactly this problem made itself apparent? I'm having a similar (the
>> same?) issue with my Sony Vaio VPCS12C5E. The backlight interface
>> registered by ACPI does not work and I have to boot with the command
>> line option "acpi_backlight=vendor". Even then two interfaces get
>> registered "nv_backlight" and "sony", only one of which (nv_backlight)
>> works.
>>
>
> My situation is that the brightness control on Lenovo B470e is broken on
> Ubuntu 12.04.5 but 12.04.2. Neither "acpi_backlight=vendor " nor
> "video.use_native_backlight=1" works for the brightness control.
>
> After bisecting, the regression happens in 3.10-rc1.
>
> Before 3.10-rc1, acpi/video.c fails to register backlight interface due to
> acpi_video_device_lcd_set_level() returns -EINVAL in
> acpi_video_init_brightness().
> Only "intel_backlight" is registered under /sys/class/backlight.
> So the brightness can be adjusted from UI.
>
> In 3.10-rc1, some changes make acpi/video.c able to register backlight
> for Lenovo B470e. "acpi_video0" is used as the default backlight interface.
>
> There is no BIOS update since 2012. And the vendor is unlikely to fix this bug.
> So I propose the patch for fixing the brightness control on Lenovo B470e.
>
>> Desktop environments (GNOME in particular) seem to be confused by this,
>> so I always have to change the brightness by writing directly into the
>> "actual_brightness" file. I've reported this back in 2012 [1], but was
>> told that it is an ACPI issue and so it never was fixed.
>>
>
> Similar situation on Toshiba T130-15T
> https://bugzilla.kernel.org/show_bug.cgi?id=50551
>
>> Couldn't a similar patch be applied to the sony-laptop module? I've
>> added Mattia Dongili to the discussion, hopefully he doesn't mind to
>> take a look at this again. I'm glad to test any patches, but am not
>> familiar enough with all of the internal structs to mess around with
>> them for myself without breaking support for other users of this module,
>> especially since my model was shipped with in two different versions:
>> One with the internal Intel GPU and another with a dedicated Nvidia GPU.
>> I'm afraid a simple DMI match might not be good enough in this case?
>>
>
> You may use dmidecode to see if there is any extra information which can
> differentiate between these two versions.
>
> Regards,
> Edward Lin
> --
> To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Chia-Lin Kao(AceLan)
http://blog.acelan.idv.tw/
E-Mail: acelan.kaoATcanonical.com (s/AT/@/)

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

* Re: [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e
  2015-01-19  3:14     ` AceLan Kao
@ 2015-01-27  2:56       ` Darren Hart
  0 siblings, 0 replies; 5+ messages in thread
From: Darren Hart @ 2015-01-27  2:56 UTC (permalink / raw)
  To: AceLan Kao; +Cc: platform-driver-x86, Karol Babioch, mattia Dongili, YK

On Mon, Jan 19, 2015 at 11:14:44AM +0800, AceLan Kao wrote:
> Hi all,
> 
> I'm wondering are there any concerns that prevent this patch from
> entering the upstream?

I don't see it anywhere in my platform-driver-x86 archives. Please resend the
patch with a reference to the original submission being sure to Cc the List and
Maintainer as listed in the MAINTAINERS file.

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center

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

end of thread, other threads:[~2015-01-27  2:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-18  6:09 [PATCH] ideapad-laptop: Use intel_backlight only on Lenovo B470e Edward Lin
2014-08-21 23:35 ` Karol Babioch
2014-08-22  6:18   ` Yidi Lin
2015-01-19  3:14     ` AceLan Kao
2015-01-27  2:56       ` Darren Hart

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.