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

Commit a5527c6a 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: Remove bogus SYSFS dependency
  backlight: simplify corgi_bl locking
  backlight: Separate backlight properties from backlight ops pointers
  backlight: Clean up pmac_backlight handling
  backlight: Improve backlight selection for fbdev drivers
  backlight: Rework backlight/fb interaction simplifying, lots
  backlight: Remove unneeded backlight update_status calls
  backlight: Remove uneeded update_status call from chipsfb.c
  backlight/fbcon: Add FB_EVENT_CONBLANK
  backlight: Fix Kconfig entries
  backlight: Remove uneeded nvidia set_power calls
  backlight: Convert semaphore -> mutex
  backlight: Fix external uses of backlight internal semaphore
  backlight: Minor code cleanups for hp680_bl.c
  backlight: Minor code cleanups for corgi_bl.c
  backlight: Remove excessive (un)likelys
  backlight: Remove unneeded owner field
  backlight: Fix error handling
  backlight: Add Frontpath ProGear HX1050+ driver
  backlight: Add maintainer entry
parents 4afffe5e 8f27489d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -679,6 +679,11 @@ L: linux-hams@vger.kernel.org
W:	http://www.linux-ax25.org/
S:	Maintained

BACKLIGHT CLASS/SUBSYSTEM
P:	Richard Purdie
M:	rpurdie@rpsys.net
S:	Maintained

BAYCOM/HDLCDRV DRIVERS FOR AX.25
P:	Thomas Sailer
M:	t.sailer@alumni.ethz.ch
+2 −4
Original line number Diff line number Diff line
@@ -107,12 +107,10 @@ int die(const char *str, struct pt_regs *regs, long err)
	if (machine_is(powermac) && pmac_backlight) {
		struct backlight_properties *props;

		down(&pmac_backlight->sem);
		props = pmac_backlight->props;
		props = &pmac_backlight->props;
		props->brightness = props->max_brightness;
		props->power = FB_BLANK_UNBLANK;
		props->update_status(pmac_backlight);
		up(&pmac_backlight->sem);
		backlight_update_status(pmac_backlight);
	}
	mutex_unlock(&pmac_backlight_mutex);
#endif
+9 −18
Original line number Diff line number Diff line
@@ -37,21 +37,20 @@ static int pmac_backlight_set_legacy_queued;
 */
static atomic_t kernel_backlight_disabled = ATOMIC_INIT(0);

/* Protect the pmac_backlight variable */
/* Protect the pmac_backlight variable below.
   You should hold this lock when using the pmac_backlight pointer to
   prevent its potential removal. */
DEFINE_MUTEX(pmac_backlight_mutex);

/* Main backlight storage
 *
 * Backlight drivers in this variable are required to have the "props"
 * Backlight drivers in this variable are required to have the "ops"
 * attribute set and to have an update_status function.
 *
 * We can only store one backlight here, but since Apple laptops have only one
 * internal display, it doesn't matter. Other backlight drivers can be used
 * independently.
 *
 * Lock ordering:
 * pmac_backlight_mutex (global, main backlight)
 *   pmac_backlight->sem (backlight class)
 */
struct backlight_device *pmac_backlight;

@@ -104,8 +103,7 @@ static void pmac_backlight_key_worker(struct work_struct *work)
		struct backlight_properties *props;
		int brightness;

		down(&pmac_backlight->sem);
		props = pmac_backlight->props;
		props = &pmac_backlight->props;

		brightness = props->brightness +
			((pmac_backlight_key_queued?-1:1) *
@@ -117,9 +115,7 @@ static void pmac_backlight_key_worker(struct work_struct *work)
			brightness = props->max_brightness;

		props->brightness = brightness;
		props->update_status(pmac_backlight);

		up(&pmac_backlight->sem);
		backlight_update_status(pmac_backlight);
	}
	mutex_unlock(&pmac_backlight_mutex);
}
@@ -145,8 +141,7 @@ static int __pmac_backlight_set_legacy_brightness(int brightness)
	if (pmac_backlight) {
		struct backlight_properties *props;

		down(&pmac_backlight->sem);
		props = pmac_backlight->props;
		props = &pmac_backlight->props;
		props->brightness = brightness *
			(props->max_brightness + 1) /
			(OLD_BACKLIGHT_MAX + 1);
@@ -156,8 +151,7 @@ static int __pmac_backlight_set_legacy_brightness(int brightness)
		else if (props->brightness < 0)
			props->brightness = 0;

		props->update_status(pmac_backlight);
		up(&pmac_backlight->sem);
		backlight_update_status(pmac_backlight);

		error = 0;
	}
@@ -196,14 +190,11 @@ int pmac_backlight_get_legacy_brightness()
	if (pmac_backlight) {
		struct backlight_properties *props;

		down(&pmac_backlight->sem);
		props = pmac_backlight->props;
		props = &pmac_backlight->props;

		result = props->brightness *
			(OLD_BACKLIGHT_MAX + 1) /
			(props->max_brightness + 1);

		up(&pmac_backlight->sem);
	}
	mutex_unlock(&pmac_backlight_mutex);

+3 −4
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ static int set_brightness(int value)

static int set_brightness_status(struct backlight_device *bd)
{
	return set_brightness(bd->props->brightness);
	return set_brightness(bd->props.brightness);
}

static int
@@ -1352,11 +1352,9 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
	return 0;
}

static struct backlight_properties asus_backlight_data = {
        .owner          = THIS_MODULE,
static struct backlight_ops asus_backlight_data = {
        .get_brightness = read_brightness,
        .update_status  = set_brightness_status,
        .max_brightness = 15,
};

static void __exit asus_acpi_exit(void)
@@ -1410,6 +1408,7 @@ static int __init asus_acpi_init(void)
		asus_backlight_device = NULL;
		asus_acpi_exit();
	}
        asus_backlight_device->props.max_brightness = 15;

	return 0;
}
+4 −4
Original line number Diff line number Diff line
@@ -1701,14 +1701,12 @@ static int brightness_write(char *buf)

static int brightness_update_status(struct backlight_device *bd)
{
	return brightness_set(bd->props->brightness);
	return brightness_set(bd->props.brightness);
}

static struct backlight_properties ibm_backlight_data = {
        .owner          = THIS_MODULE,
static struct backlight_ops ibm_backlight_data = {
        .get_brightness = brightness_get,
        .update_status  = brightness_update_status,
        .max_brightness = 7,
};

static int brightness_init(void)
@@ -1720,6 +1718,8 @@ static int brightness_init(void)
		return PTR_ERR(ibm_backlight_device);
	}

        ibm_backlight_device->props.max_brightness = 7;

	return 0;
}

Loading