v3:
Split patch 3/3 in v2 into 2 patches: one makes changes to acpi_video
and one adds the int3406 driver as suggested by Rafael. There should
be no functionality change compared to v2.
v2:
The display thermal device represents the LED/LCD display panel
that may or may not include touch support. The main function of
the display thermal device is to allow control of the display
brightness in order to address a thermal condition or to reduce
power consumed by display device.
Due to the way this thermal device changes brightness level is said
to be deprecated so we are using the raw interface to do the actual
backlight change. This requires the backlight core support so two
new APIs are added and exported in patch 1/3. With this, the previous
API backlight_device_registered can be removed and this is done in
patch 2/3. Patch 3/3 adds the new int3406 thermal driver.
The 1st version is here:
http://thread.gmane.org/gmane.linux.acpi.devel/72619
This whole series should go through the thermal tree if applied.
Aaron Lu (3):
video / backlight: add two APIs for drivers to use
video / backlight: remove the backlight_device_registered API
Thermal: add INT3406 thermal driver
drivers/acpi/acpi_video.c | 83 ++++----
drivers/acpi/video_detect.c | 2 +-
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
drivers/video/backlight/backlight.c | 39 ++--
include/acpi/video.h | 20 ++
include/linux/backlight.h | 3 +-
9 files changed, 374 insertions(+), 80 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
--
2.5.5
INT3406 ACPI device object resembles an ACPI video output device, but its
_BCM is said to be deprecated and should not be used. So we will make
use of the raw interface to do the actual cooling.
Signed-off-by: Aaron Lu <redacted>
---
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
4 files changed, 282 insertions(+), 25 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
It is useful to get the backlight device's pointer and use it to set
backlight in some cases(the following patch will make use of it) so add
the two APIs and export them.
Signed-off-by: Aaron Lu <redacted>
Acked-by: Jingoo Han <redacted>
---
drivers/video/backlight/backlight.c | 43 +++++++++++++++++++++++++------------
include/linux/backlight.h | 2 ++
2 files changed, 31 insertions(+), 14 deletions(-)
Since we will need the backlight_device_get_by_type API, we can use it
instead of the backlight_device_registered API whenever necessary so
remove the backlight_device_registered API.
Signed-off-by: Aaron Lu <redacted>
Acked-by: Jingoo Han <redacted>
---
drivers/acpi/video_detect.c | 2 +-
drivers/video/backlight/backlight.c | 6 ------
include/linux/backlight.h | 1 -
3 files changed, 1 insertion(+), 8 deletions(-)
The acpi_video_get_levels is useful for other drivers, i.e. the
to-be-added int3406 thermal driver, so export it.
Signed-off-by: Aaron Lu <redacted>
---
drivers/acpi/acpi_video.c | 83 +++++++++++++++++++++++++----------------------
include/acpi/video.h | 20 ++++++++++++
2 files changed, 65 insertions(+), 38 deletions(-)
@@ -191,19 +191,6 @@ struct acpi_video_device_cap {u8_DDC:1;/* Return the EDID for this device */};-structacpi_video_brightness_flags{-u8_BCL_no_ac_battery_levels:1;/* no AC/Battery levels in _BCL */-u8_BCL_reversed:1;/* _BCL package is in a reversed order */-u8_BQC_use_index:1;/* _BQC returns an index value */-};--structacpi_video_device_brightness{-intcurr;-intcount;-int*levels;-structacpi_video_brightness_flagsflags;-};-structacpi_video_device{unsignedlongdevice_id;structacpi_video_device_flagsflags;
@@ -766,36 +753,28 @@ static int acpi_video_bqc_quirk(struct acpi_video_device *device,return0;}--/*-*Arg:-*device:videooutputdevice(LCD,CRT,..)-*-*ReturnValue:-*Maximumbrightnesslevel-*-*Allocateandinitializedevice->brightness.-*/--staticint-acpi_video_init_brightness(structacpi_video_device*device)+intacpi_video_get_levels(structacpi_device*device,+structacpi_video_device_brightness**dev_br){unionacpi_object*obj=NULL;inti,max_level=0,count=0,level_ac_battery=0;-unsignedlonglonglevel,level_old;unionacpi_object*o;structacpi_video_device_brightness*br=NULL;-intresult=-EINVAL;+intresult=0;u32value;-if(!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device,&obj))){+if(!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle,+&obj))){ACPI_DEBUG_PRINT((ACPI_DB_INFO,"Could not query available ""LCD brightness level\n"));+result=-ENODEV;gotoout;}-if(obj->package.count<2)+if(obj->package.count<2){+result=-EINVAL;gotoout;+}br=kzalloc(sizeof(*br),GFP_KERNEL);if(!br){
@@ -861,6 +840,38 @@ acpi_video_init_brightness(struct acpi_video_device *device)"Found unordered _BCL package"));br->count=count;+*dev_br=br;++out:+kfree(obj);+returnresult;+out_free:+kfree(br);+gotoout;+}+EXPORT_SYMBOL(acpi_video_get_levels);++/*+*Arg:+*device:videooutputdevice(LCD,CRT,..)+*+*ReturnValue:+*Maximumbrightnesslevel+*+*Allocateandinitializedevice->brightness.+*/++staticint+acpi_video_init_brightness(structacpi_video_device*device)+{+inti,max_level=0;+unsignedlonglonglevel,level_old;+structacpi_video_device_brightness*br=NULL;+intresult=-EINVAL;++result=acpi_video_get_levels(device->dev,&br);+if(result)+returnresult;device->brightness=br;/* _BQC uses INDEX while _BCL uses VALUE in some laptops */
@@ -4,6 +4,19 @@#include<linux/errno.h> /* for ENODEV */#include<linux/types.h> /* for bool */+structacpi_video_brightness_flags{+u8_BCL_no_ac_battery_levels:1;/* no AC/Battery levels in _BCL */+u8_BCL_reversed:1;/* _BCL package is in a reversed order */+u8_BQC_use_index:1;/* _BQC returns an index value */+};++structacpi_video_device_brightness{+intcurr;+intcount;+int*levels;+structacpi_video_brightness_flagsflags;+};+structacpi_device;#define ACPI_VIDEO_CLASS "video"
From: "Rafael J. Wysocki" <rafael@kernel.org> Date: 2016-04-27 19:38:40
On Wed, Apr 27, 2016 at 2:45 PM, Aaron Lu [off-list ref] wrote:
v3:
Split patch 3/3 in v2 into 2 patches: one makes changes to acpi_video
and one adds the int3406 driver as suggested by Rafael. There should
be no functionality change compared to v2.
v2:
The display thermal device represents the LED/LCD display panel
that may or may not include touch support. The main function of
the display thermal device is to allow control of the display
brightness in order to address a thermal condition or to reduce
power consumed by display device.
Due to the way this thermal device changes brightness level is said
to be deprecated so we are using the raw interface to do the actual
backlight change. This requires the backlight core support so two
new APIs are added and exported in patch 1/3. With this, the previous
API backlight_device_registered can be removed and this is done in
patch 2/3. Patch 3/3 adds the new int3406 thermal driver.
The 1st version is here:
http://thread.gmane.org/gmane.linux.acpi.devel/72619
This whole series should go through the thermal tree if applied.
Aaron Lu (3):
video / backlight: add two APIs for drivers to use
video / backlight: remove the backlight_device_registered API
Thermal: add INT3406 thermal driver
drivers/acpi/acpi_video.c | 83 ++++----
drivers/acpi/video_detect.c | 2 +-
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
drivers/video/backlight/backlight.c | 39 ++--
include/acpi/video.h | 20 ++
include/linux/backlight.h | 3 +-
9 files changed, 374 insertions(+), 80 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
The first three patches in this series look OK to me, so
Acked-by: Rafael J. Wysocki <redacted>
for the [1-3/4].
That said it may be better if those three go in via ACPI. I can put
them into a separate branch for Rui to pull from.
Please let me know what you think.
On Wed, Apr 27, 2016 at 2:45 PM, Aaron Lu [off-list ref] wrote:
quoted
v3:
Split patch 3/3 in v2 into 2 patches: one makes changes to acpi_video
and one adds the int3406 driver as suggested by Rafael. There should
be no functionality change compared to v2.
v2:
The display thermal device represents the LED/LCD display panel
that may or may not include touch support. The main function of
the display thermal device is to allow control of the display
brightness in order to address a thermal condition or to reduce
power consumed by display device.
Due to the way this thermal device changes brightness level is said
to be deprecated so we are using the raw interface to do the actual
backlight change. This requires the backlight core support so two
new APIs are added and exported in patch 1/3. With this, the previous
API backlight_device_registered can be removed and this is done in
patch 2/3. Patch 3/3 adds the new int3406 thermal driver.
The 1st version is here:
http://thread.gmane.org/gmane.linux.acpi.devel/72619
This whole series should go through the thermal tree if applied.
Aaron Lu (3):
video / backlight: add two APIs for drivers to use
video / backlight: remove the backlight_device_registered API
Thermal: add INT3406 thermal driver
drivers/acpi/acpi_video.c | 83 ++++----
drivers/acpi/video_detect.c | 2 +-
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
drivers/video/backlight/backlight.c | 39 ++--
include/acpi/video.h | 20 ++
include/linux/backlight.h | 3 +-
9 files changed, 374 insertions(+), 80 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
The first three patches in this series look OK to me, so
Acked-by: Rafael J. Wysocki <redacted>
for the [1-3/4].
That said it may be better if those three go in via ACPI. I can put
them into a separate branch for Rui to pull from.
Please let me know what you think.
From: Rafael J. Wysocki <hidden> Date: 2016-05-04 21:44:09
On Thursday, April 28, 2016 09:48:30 AM Aaron Lu wrote:
On 04/28/2016 03:38 AM, Rafael J. Wysocki wrote:
quoted
On Wed, Apr 27, 2016 at 2:45 PM, Aaron Lu [off-list ref] wrote:
quoted
v3:
Split patch 3/3 in v2 into 2 patches: one makes changes to acpi_video
and one adds the int3406 driver as suggested by Rafael. There should
be no functionality change compared to v2.
v2:
The display thermal device represents the LED/LCD display panel
that may or may not include touch support. The main function of
the display thermal device is to allow control of the display
brightness in order to address a thermal condition or to reduce
power consumed by display device.
Due to the way this thermal device changes brightness level is said
to be deprecated so we are using the raw interface to do the actual
backlight change. This requires the backlight core support so two
new APIs are added and exported in patch 1/3. With this, the previous
API backlight_device_registered can be removed and this is done in
patch 2/3. Patch 3/3 adds the new int3406 thermal driver.
The 1st version is here:
http://thread.gmane.org/gmane.linux.acpi.devel/72619
This whole series should go through the thermal tree if applied.
Aaron Lu (3):
video / backlight: add two APIs for drivers to use
video / backlight: remove the backlight_device_registered API
Thermal: add INT3406 thermal driver
drivers/acpi/acpi_video.c | 83 ++++----
drivers/acpi/video_detect.c | 2 +-
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
drivers/video/backlight/backlight.c | 39 ++--
include/acpi/video.h | 20 ++
include/linux/backlight.h | 3 +-
9 files changed, 374 insertions(+), 80 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
The first three patches in this series look OK to me, so
Acked-by: Rafael J. Wysocki <redacted>
for the [1-3/4].
That said it may be better if those three go in via ACPI. I can put
them into a separate branch for Rui to pull from.
Please let me know what you think.
I have no problem with that.
OK
[1-3/4] have been queued up for 4.7 in my tree. Please let me know if you
want me to expose the branch containing them.
Thanks,
Rafael
On Thursday, April 28, 2016 09:48:30 AM Aaron Lu wrote:
quoted
On 04/28/2016 03:38 AM, Rafael J. Wysocki wrote:
quoted
On Wed, Apr 27, 2016 at 2:45 PM, Aaron Lu [off-list ref] wrote:
quoted
v3:
Split patch 3/3 in v2 into 2 patches: one makes changes to acpi_video
and one adds the int3406 driver as suggested by Rafael. There should
be no functionality change compared to v2.
v2:
The display thermal device represents the LED/LCD display panel
that may or may not include touch support. The main function of
the display thermal device is to allow control of the display
brightness in order to address a thermal condition or to reduce
power consumed by display device.
Due to the way this thermal device changes brightness level is said
to be deprecated so we are using the raw interface to do the actual
backlight change. This requires the backlight core support so two
new APIs are added and exported in patch 1/3. With this, the previous
API backlight_device_registered can be removed and this is done in
patch 2/3. Patch 3/3 adds the new int3406 thermal driver.
The 1st version is here:
http://thread.gmane.org/gmane.linux.acpi.devel/72619
This whole series should go through the thermal tree if applied.
Aaron Lu (3):
video / backlight: add two APIs for drivers to use
video / backlight: remove the backlight_device_registered API
Thermal: add INT3406 thermal driver
drivers/acpi/acpi_video.c | 83 ++++----
drivers/acpi/video_detect.c | 2 +-
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
drivers/video/backlight/backlight.c | 39 ++--
include/acpi/video.h | 20 ++
include/linux/backlight.h | 3 +-
9 files changed, 374 insertions(+), 80 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
The first three patches in this series look OK to me, so
Acked-by: Rafael J. Wysocki <redacted>
for the [1-3/4].
That said it may be better if those three go in via ACPI. I can put
them into a separate branch for Rui to pull from.
Please let me know what you think.
I have no problem with that.
OK
[1-3/4] have been queued up for 4.7 in my tree. Please let me know if you
want me to expose the branch containing them.
Thanks a lot!
Rui,
Do you need a branch so that you can pull and merge 4/4 on top of that?
Regards,
Aaron
INT3406 ACPI device object resembles an ACPI video output device, but its
_BCM is said to be deprecated and should not be used. So we will make
use of the raw interface to do the actual cooling.
Signed-off-by: Aaron Lu <redacted>
---
update: change copyright to 2016 and license to GPL v2 as suggested by Rui.
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
4 files changed, 282 insertions(+), 25 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
From: "Rafael J. Wysocki" <rafael@kernel.org> Date: 2016-05-09 12:23:30
On Mon, May 9, 2016 at 9:49 AM, Zhang, Rui [off-list ref] wrote:
On Fri, 2016-05-06 at 14:45 +0800, Aaron Lu wrote:
quoted
On 05/05/2016 05:47 AM, Rafael J. Wysocki wrote:
quoted
On Thursday, April 28, 2016 09:48:30 AM Aaron Lu wrote:
quoted
On 04/28/2016 03:38 AM, Rafael J. Wysocki wrote:
quoted
On Wed, Apr 27, 2016 at 2:45 PM, Aaron Lu [off-list ref] wrote:
quoted
v3:
Split patch 3/3 in v2 into 2 patches: one makes changes to acpi_video
and one adds the int3406 driver as suggested by Rafael. There should
be no functionality change compared to v2.
v2:
The display thermal device represents the LED/LCD display panel
that may or may not include touch support. The main function of
the display thermal device is to allow control of the display
brightness in order to address a thermal condition or to reduce
power consumed by display device.
Due to the way this thermal device changes brightness level is said
to be deprecated so we are using the raw interface to do the actual
backlight change. This requires the backlight core support so two
new APIs are added and exported in patch 1/3. With this, the previous
API backlight_device_registered can be removed and this is done in
patch 2/3. Patch 3/3 adds the new int3406 thermal driver.
The 1st version is here:
http://thread.gmane.org/gmane.linux.acpi.devel/72619
This whole series should go through the thermal tree if applied.
Aaron Lu (3):
video / backlight: add two APIs for drivers to use
video / backlight: remove the backlight_device_registered API
Thermal: add INT3406 thermal driver
drivers/acpi/acpi_video.c | 83 ++++----
drivers/acpi/video_detect.c | 2 +-
drivers/thermal/Kconfig | 28 +--
drivers/thermal/int340x_thermal/Kconfig | 42 ++++
drivers/thermal/int340x_thermal/Makefile | 1 +
drivers/thermal/int340x_thermal/int3406_thermal.c | 236 ++++++++++++++++++++++
drivers/video/backlight/backlight.c | 39 ++--
include/acpi/video.h | 20 ++
include/linux/backlight.h | 3 +-
9 files changed, 374 insertions(+), 80 deletions(-)
create mode 100644 drivers/thermal/int340x_thermal/Kconfig
create mode 100644 drivers/thermal/int340x_thermal/int3406_thermal.c
The first three patches in this series look OK to me, so
Acked-by: Rafael J. Wysocki <redacted>
for the [1-3/4].
That said it may be better if those three go in via ACPI. I can put
them into a separate branch for Rui to pull from.
Please let me know what you think.
I have no problem with that.
OK
[1-3/4] have been queued up for 4.7 in my tree. Please let me know if you
want me to expose the branch containing them.
Thanks a lot!
Rui,
Do you need a branch so that you can pull and merge 4/4 on top of that?
Rafael, can you please take patch 4/4 as well?
It should not conflict with my other thermal material.
From: Rafael J. Wysocki <hidden> Date: 2016-05-13 22:05:24
On Tuesday, May 10, 2016 08:08:52 AM Zhang, Rui wrote:
On Mon, 2016-05-09 at 15:54 +0800, Aaron Lu wrote:
quoted
INT3406 ACPI device object resembles an ACPI video output device, but its
_BCM is said to be deprecated and should not be used. So we will make
use of the raw interface to do the actual cooling.
Signed-off-by: Aaron Lu <redacted>