Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61d71807 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight

* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
  backlight: panasonic-laptop - Fix incomplete registration failure handling
  backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling
  backlight: blackfin - Fix missing registration failure handling
  backlight: classmate-laptop - Fix missing registration failure handling
  backlight: mbp_nvidia_bl - add five more MacBook variants
  backlight: Allow properties to be passed at registration
  backlight: Add backlight_device parameter to check_fb
  video: backlight/progear, fix pci device refcounting
  backlight: l4f00242t03: Fix module licence absence.
  backlight: Revert some const qualifiers
  backlight: Add Epson L4F00242T03 LCD driver
parents 5dbc2f54 ec57af9c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -998,6 +998,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
	}

	if (acpi_video_backlight_support()) {
		struct backlight_properties props;
		int result;
		static int count = 0;
		char *name;
@@ -1010,12 +1011,14 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
			return;

		sprintf(name, "acpi_video%d", count++);
		device->backlight = backlight_device_register(name,
			NULL, device, &acpi_backlight_ops);
		memset(&props, 0, sizeof(struct backlight_properties));
		props.max_brightness = device->brightness->count - 3;
		device->backlight = backlight_device_register(name, NULL, device,
							      &acpi_backlight_ops,
							      &props);
		kfree(name);
		if (IS_ERR(device->backlight))
			return;
		device->backlight->props.max_brightness = device->brightness->count-3;

		result = sysfs_create_link(&device->backlight->dev.kobj,
					   &device->dev->dev.kobj, "device");
+8 −4
Original line number Diff line number Diff line
@@ -89,19 +89,21 @@ static struct backlight_ops nv50_bl_ops = {

static int nouveau_nv40_backlight_init(struct drm_device *dev)
{
	struct backlight_properties props;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct backlight_device *bd;

	if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK))
		return 0;

	memset(&props, 0, sizeof(struct backlight_properties));
	props.max_brightness = 31;
	bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev,
				       &nv40_bl_ops);
				       &nv40_bl_ops, &props);
	if (IS_ERR(bd))
		return PTR_ERR(bd);

	dev_priv->backlight = bd;
	bd->props.max_brightness = 31;
	bd->props.brightness = nv40_get_intensity(bd);
	backlight_update_status(bd);

@@ -110,19 +112,21 @@ static int nouveau_nv40_backlight_init(struct drm_device *dev)

static int nouveau_nv50_backlight_init(struct drm_device *dev)
{
	struct backlight_properties props;
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct backlight_device *bd;

	if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT))
		return 0;

	memset(&props, 0, sizeof(struct backlight_properties));
	props.max_brightness = 1025;
	bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev,
				       &nv50_bl_ops);
				       &nv50_bl_ops, &props);
	if (IS_ERR(bd))
		return PTR_ERR(bd);

	dev_priv->backlight = bd;
	bd->props.max_brightness = 1025;
	bd->props.brightness = nv50_get_intensity(bd);
	backlight_update_status(bd);
	return 0;
+5 −2
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ void pmu_backlight_set_sleep(int sleep)

void __init pmu_backlight_init()
{
	struct backlight_properties props;
	struct backlight_device *bd;
	char name[10];
	int level, autosave;
@@ -161,13 +162,15 @@ void __init pmu_backlight_init()

	snprintf(name, sizeof(name), "pmubl");

	bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data);
	memset(&props, 0, sizeof(struct backlight_properties));
	props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
	bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data,
				       &props);
	if (IS_ERR(bd)) {
		printk(KERN_ERR "PMU Backlight registration failed\n");
		return;
	}
	uses_pmu_bl = 1;
	bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
	pmu_backlight_init_curve(0x7F, 0x46, 0x0E);

	level = bd->props.max_brightness;
+5 −2
Original line number Diff line number Diff line
@@ -922,9 +922,13 @@ static struct backlight_ops acer_bl_ops = {

static int __devinit acer_backlight_init(struct device *dev)
{
	struct backlight_properties props;
	struct backlight_device *bd;

	bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops);
	memset(&props, 0, sizeof(struct backlight_properties));
	props.max_brightness = max_brightness;
	bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops,
				       &props);
	if (IS_ERR(bd)) {
		printk(ACER_ERR "Could not register Acer backlight device\n");
		acer_backlight_device = NULL;
@@ -935,7 +939,6 @@ static int __devinit acer_backlight_init(struct device *dev)

	bd->props.power = FB_BLANK_UNBLANK;
	bd->props.brightness = read_brightness(bd);
	bd->props.max_brightness = max_brightness;
	backlight_update_status(bd);
	return 0;
}
+5 −2
Original line number Diff line number Diff line
@@ -639,12 +639,16 @@ static int asus_backlight_init(struct asus_laptop *asus)
{
	struct backlight_device *bd;
	struct device *dev = &asus->platform_device->dev;
	struct backlight_properties props;

	if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) &&
	    !acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) &&
	    lcd_switch_handle) {
		memset(&props, 0, sizeof(struct backlight_properties));
		props.max_brightness = 15;

		bd = backlight_device_register(ASUS_LAPTOP_FILE, dev,
					       asus, &asusbl_ops);
					       asus, &asusbl_ops, &props);
		if (IS_ERR(bd)) {
			pr_err("Could not register asus backlight device\n");
			asus->backlight_device = NULL;
@@ -653,7 +657,6 @@ static int asus_backlight_init(struct asus_laptop *asus)

		asus->backlight_device = bd;

		bd->props.max_brightness = 15;
		bd->props.power = FB_BLANK_UNBLANK;
		bd->props.brightness = asus_read_brightness(bd);
		backlight_update_status(bd);
Loading