Skip to content

Commit

Permalink
Merge branches 'acpi-battery' and 'acpi-video'
Browse files Browse the repository at this point in the history
* acpi-battery:
  ACPI / AC: recheck adapter status upon battery status changes
  ACPI / battery: call ACPI notifier chain in acpi_battery_notify
  ACPI / battery: move some ACPI_BATTERY_* definitions to header

* acpi-video:
  video / output: Drop display output class support
  fujitsu-laptop: Drop unneeded include
  acer-wmi: Stop selecting VIDEO_OUTPUT_CONTROL
  ACPI / gpu / drm: Stop selecting VIDEO_OUTPUT_CONTROL
  ACPI / video: fix ACPI_VIDEO dependencies
  • Loading branch information
rafaeljw committed Mar 20, 2014
3 parents e25c5ab + 4eee4f0 + f167a64 commit 94a81ca
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 211 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ config ACPI_BUTTON

config ACPI_VIDEO
tristate "Video"
depends on X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL
depends on X86 && BACKLIGHT_CLASS_DEVICE
depends on INPUT
select THERMAL
help
Expand Down
25 changes: 25 additions & 0 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/acpi.h>
#include "battery.h"

#define PREFIX "ACPI: "

Expand All @@ -57,6 +58,7 @@ struct acpi_ac {
struct power_supply charger;
struct platform_device *pdev;
unsigned long long state;
struct notifier_block battery_nb;
};

#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger)
Expand Down Expand Up @@ -152,6 +154,26 @@ static void acpi_ac_notify_handler(acpi_handle handle, u32 event, void *data)
return;
}

static int acpi_ac_battery_notify(struct notifier_block *nb,
unsigned long action, void *data)
{
struct acpi_ac *ac = container_of(nb, struct acpi_ac, battery_nb);
struct acpi_bus_event *event = (struct acpi_bus_event *)data;

/*
* On HP Pavilion dv6-6179er AC status notifications aren't triggered
* when adapter is plugged/unplugged. However, battery status
* notifcations are triggered when battery starts charging or
* discharging. Re-reading AC status triggers lost AC notifications,
* if AC status has changed.
*/
if (strcmp(event->device_class, ACPI_BATTERY_CLASS) == 0 &&
event->type == ACPI_BATTERY_NOTIFY_STATUS)
acpi_ac_get_state(ac);

return NOTIFY_OK;
}

static int thinkpad_e530_quirk(const struct dmi_system_id *d)
{
ac_sleep_before_get_state_ms = 1000;
Expand Down Expand Up @@ -215,6 +237,8 @@ static int acpi_ac_probe(struct platform_device *pdev)
acpi_device_name(adev), acpi_device_bid(adev),
ac->state ? "on-line" : "off-line");

ac->battery_nb.notifier_call = acpi_ac_battery_notify;
register_acpi_notifier(&ac->battery_nb);
end:
if (result)
kfree(ac);
Expand Down Expand Up @@ -261,6 +285,7 @@ static int acpi_ac_remove(struct platform_device *pdev)
ac = platform_get_drvdata(pdev);
if (ac->charger.dev)
power_supply_unregister(&ac->charger);
unregister_acpi_notifier(&ac->battery_nb);

kfree(ac);

Expand Down
7 changes: 3 additions & 4 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@
#include <linux/acpi.h>
#include <linux/power_supply.h>

#include "battery.h"

#define PREFIX "ACPI: "

#define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF

#define ACPI_BATTERY_CLASS "battery"
#define ACPI_BATTERY_DEVICE_NAME "Battery"
#define ACPI_BATTERY_NOTIFY_STATUS 0x80
#define ACPI_BATTERY_NOTIFY_INFO 0x81
#define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82

/* Battery power unit: 0 means mW, 1 means mA */
#define ACPI_BATTERY_POWER_UNIT_MA 1
Expand Down Expand Up @@ -736,6 +734,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event,
acpi_battery_present(battery));
acpi_notifier_call_chain(device, event, acpi_battery_present(battery));
/* acpi_battery_update could remove power_supply object */
if (old && battery->bat.dev)
power_supply_changed(&battery->bat);
Expand Down
10 changes: 10 additions & 0 deletions drivers/acpi/battery.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef __ACPI_BATTERY_H
#define __ACPI_BATTERY_H

#define ACPI_BATTERY_CLASS "battery"

#define ACPI_BATTERY_NOTIFY_STATUS 0x80
#define ACPI_BATTERY_NOTIFY_INFO 0x81
#define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82

#endif
2 changes: 1 addition & 1 deletion drivers/acpi/sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
#include <linux/power_supply.h>

#include "sbshc.h"
#include "battery.h"

#define PREFIX "ACPI: "

#define ACPI_SBS_CLASS "sbs"
#define ACPI_AC_CLASS "ac_adapter"
#define ACPI_BATTERY_CLASS "battery"
#define ACPI_SBS_DEVICE_NAME "Smart Battery System"
#define ACPI_SBS_FILE_INFO "info"
#define ACPI_SBS_FILE_STATE "state"
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/gma500/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ config DRM_GMA500
# GMA500 depends on ACPI_VIDEO when ACPI is enabled, just like i915
select ACPI_VIDEO if ACPI
select BACKLIGHT_CLASS_DEVICE if ACPI
select VIDEO_OUTPUT_CONTROL if ACPI
select INPUT if ACPI
help
Say yes for an experimental 2D KMS framebuffer driver for the
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ config DRM_I915
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
select BACKLIGHT_LCD_SUPPORT if ACPI
select BACKLIGHT_CLASS_DEVICE if ACPI
select VIDEO_OUTPUT_CONTROL if ACPI
select INPUT if ACPI
select ACPI_VIDEO if ACPI
select ACPI_BUTTON if ACPI
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ config DRM_NOUVEAU
select FB
select FRAMEBUFFER_CONSOLE if !EXPERT
select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && INPUT
select X86_PLATFORM_DEVICES if ACPI && X86
select ACPI_WMI if ACPI && X86
select MXM_WMI if ACPI && X86
select POWER_SUPPLY
# Similar to i915, we need to select ACPI_VIDEO and it's dependencies
select BACKLIGHT_LCD_SUPPORT if ACPI && X86
select BACKLIGHT_CLASS_DEVICE if ACPI && X86
select VIDEO_OUTPUT_CONTROL if ACPI && X86
select INPUT if ACPI && X86
select THERMAL if ACPI && X86
select ACPI_VIDEO if ACPI && X86
Expand Down
2 changes: 0 additions & 2 deletions drivers/platform/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ config ACER_WMI
depends on ACPI_WMI
select INPUT_SPARSEKMAP
# Acer WMI depends on ACPI_VIDEO when ACPI is enabled
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
select VIDEO_OUTPUT_CONTROL if ACPI
select ACPI_VIDEO if ACPI
---help---
This is a driver for newer Acer (and Wistron) laptops. It adds
Expand Down
1 change: 0 additions & 1 deletion drivers/platform/x86/fujitsu-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#include <linux/backlight.h>
#include <linux/input.h>
#include <linux/kfifo.h>
#include <linux/video_output.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
Expand Down
6 changes: 0 additions & 6 deletions drivers/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ config VGASTATE
tristate
default n

config VIDEO_OUTPUT_CONTROL
tristate "Lowlevel video output switch controls"
help
This framework adds support for low-level control of the video
output switch.

config VIDEOMODE_HELPERS
bool

Expand Down
2 changes: 0 additions & 2 deletions drivers/video/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ obj-$(CONFIG_FB_SIMPLE) += simplefb.o
# the test framebuffer is last
obj-$(CONFIG_FB_VIRTUAL) += vfb.o

#video output switch sysfs driver
obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o
obj-$(CONFIG_VIDEOMODE_HELPERS) += display_timing.o videomode.o
ifeq ($(CONFIG_OF),y)
obj-$(CONFIG_VIDEOMODE_HELPERS) += of_display_timing.o of_videomode.o
Expand Down
133 changes: 0 additions & 133 deletions drivers/video/output.c

This file was deleted.

57 changes: 0 additions & 57 deletions include/linux/video_output.h

This file was deleted.

0 comments on commit 94a81ca

Please sign in to comment.