Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1407390
| From | Aaron Lu <aaron.lu@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] ACPI / Thermal / video: fix max_level incorrect value |
| Date | 2016-05-26 07:20 +0200 |
| Message-ID | <rCVSa-2eN-1@gated-at.bofh.it> (permalink) |
| References | (7 earlier) <rB2O5-4EM-5@gated-at.bofh.it> <rB5LX-6HR-1@gated-at.bofh.it> <rB9Zf-NK-5@gated-at.bofh.it> <rCzoC-5pR-3@gated-at.bofh.it> <rCSAV-8jK-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 05/26/2016 09:49 AM, Valdis.Kletnieks@vt.edu wrote:
> On Wed, 25 May 2016 13:15:26 +0800, Aaron Lu said:
>> Valdis, can you please give the patch a try? Thanks.
>
> Sorry, had a few days where actual work commitments and other
> things got in the way... I tested this patch against next-20160524,
> and can report that the problem is fixed, so feel free to
> stick a "Tested-By:" on it....
Thanks a lot for the confirm, here is the updated patch with your
tested-by tag added.
From: Aaron Lu <aaron.lu@intel.com>
Date: Sat, 21 May 2016 15:30:46 +0800
Subject: [PATCH] ACPI / Thermal / video: fix max_level incorrect value
commit 059500940def("ACPI/video: export acpi_video_get_levels")
mistakenly dropped the correct value of max_level and that caused the
set_level function following failed and the acpi_video backlight interface
didn't get created. Fix this by passing back the correct max_level value.
While at it, also fix the param used in acpi_video_device_lcd_query_levels
where acpi_handle is expected but acpi_video_device is passed.
Reported-and-tested-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
drivers/acpi/acpi_video.c | 9 ++++++---
drivers/thermal/int340x_thermal/int3406_thermal.c | 2 +-
include/acpi/video.h | 6 ++++--
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 3d5b8a099351..c1d138e128cb 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -754,7 +754,8 @@ static int acpi_video_bqc_quirk(struct acpi_video_device *device,
}
int acpi_video_get_levels(struct acpi_device *device,
- struct acpi_video_device_brightness **dev_br)
+ struct acpi_video_device_brightness **dev_br,
+ int *pmax_level)
{
union acpi_object *obj = NULL;
int i, max_level = 0, count = 0, level_ac_battery = 0;
@@ -841,6 +842,8 @@ int acpi_video_get_levels(struct acpi_device *device,
br->count = count;
*dev_br = br;
+ if (pmax_level)
+ *pmax_level = max_level;
out:
kfree(obj);
@@ -869,7 +872,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
struct acpi_video_device_brightness *br = NULL;
int result = -EINVAL;
- result = acpi_video_get_levels(device->dev, &br);
+ result = acpi_video_get_levels(device->dev, &br, &max_level);
if (result)
return result;
device->brightness = br;
@@ -1737,7 +1740,7 @@ static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video)
mutex_lock(&video->device_list_lock);
list_for_each_entry(dev, &video->video_device_list, entry) {
- if (!acpi_video_device_lcd_query_levels(dev, &levels))
+ if (!acpi_video_device_lcd_query_levels(dev->dev->handle, &levels))
kfree(levels);
}
mutex_unlock(&video->device_list_lock);
diff --git a/drivers/thermal/int340x_thermal/int3406_thermal.c b/drivers/thermal/int340x_thermal/int3406_thermal.c
index 13d431cbd29e..a578cd257db4 100644
--- a/drivers/thermal/int340x_thermal/int3406_thermal.c
+++ b/drivers/thermal/int340x_thermal/int3406_thermal.c
@@ -177,7 +177,7 @@ static int int3406_thermal_probe(struct platform_device *pdev)
return -ENODEV;
d->raw_bd = bd;
- ret = acpi_video_get_levels(ACPI_COMPANION(&pdev->dev), &d->br);
+ ret = acpi_video_get_levels(ACPI_COMPANION(&pdev->dev), &d->br, NULL);
if (ret)
return ret;
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 70a41f742037..5731ccb42585 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -51,7 +51,8 @@ extern void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type);
*/
extern bool acpi_video_handles_brightness_key_presses(void);
extern int acpi_video_get_levels(struct acpi_device *device,
- struct acpi_video_device_brightness **dev_br);
+ struct acpi_video_device_brightness **dev_br,
+ int *pmax_level);
#else
static inline int acpi_video_register(void) { return 0; }
static inline void acpi_video_unregister(void) { return; }
@@ -72,7 +73,8 @@ static inline bool acpi_video_handles_brightness_key_presses(void)
return false;
}
static inline int acpi_video_get_levels(struct acpi_device *device,
- struct acpi_video_device_brightness **dev_br)
+ struct acpi_video_device_brightness **dev_br,
+ int *pmax_level)
{
return -ENODEV;
}
--
2.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
linux-next 20160512 - ACPI issue with screen brightness Valdis Kletnieks <Valdis.Kletnieks@vt.edu> - 2016-05-17 20:50 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness "Rafael J. Wysocki" <rafael@kernel.org> - 2016-05-17 23:00 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Valdis.Kletnieks@vt.edu - 2016-05-20 01:00 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Valdis.Kletnieks@vt.edu - 2016-05-20 05:10 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Aaron Lu <aaron.lu@intel.com> - 2016-05-20 07:50 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Valdis.Kletnieks@vt.edu - 2016-05-20 09:10 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Aaron Lu <aaron.lu@intel.com> - 2016-05-20 09:20 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Aaron Lu <aaron.lu@intel.com> - 2016-05-20 09:40 +0200
Re: linux-next 20160512 - ACPI issue with screen brightness Aaron Lu <aaron.lu@intel.com> - 2016-05-21 05:30 +0200
[PATCH] ACPI / Thermal / video: fix max_level incorrect value Aaron Lu <aaron.lu@intel.com> - 2016-05-21 10:00 +0200
Re: [PATCH] ACPI / Thermal / video: fix max_level incorrect value Aaron Lu <aaron.lu@intel.com> - 2016-05-25 07:20 +0200
Re: [PATCH] ACPI / Thermal / video: fix max_level incorrect value Valdis.Kletnieks@vt.edu - 2016-05-26 03:50 +0200
Re: [PATCH] ACPI / Thermal / video: fix max_level incorrect value Aaron Lu <aaron.lu@intel.com> - 2016-05-26 07:20 +0200
Re: [PATCH] ACPI / Thermal / video: fix max_level incorrect value "Zhang, Rui" <rui.zhang@intel.com> - 2016-05-27 02:50 +0200
csiph-web