14 #include <linux/pci.h>
16 #ifdef CONFIG_PMAC_BACKLIGHT
27 #define MIN_LEVEL 0x158
28 #define MAX_LEVEL 0x534
29 #define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
31 static int nvidia_bl_get_level_brightness(
struct nvidia_par *par,
54 u32 tmp_pcrt, tmp_pmc, fpcontrol;
64 level = bd->
props.brightness;
66 tmp_pmc =
NV_RD32(par->
PMC, 0x10F0) & 0x0000FFFF;
73 tmp_pmc |= nvidia_bl_get_level_brightness(par, level) << 16;
76 fpcontrol |= 0x20000022;
87 return bd->
props.brightness;
91 .get_brightness = nvidia_bl_get_brightness,
92 .update_status = nvidia_bl_update_status,
105 #ifdef CONFIG_PMAC_BACKLIGHT
106 if (!machine_is(powermac) ||
129 bd->
props.brightness = bd->
props.max_brightness;
131 backlight_update_status(bd);
133 printk(
"nvidia: Backlight initialized (%s)\n", name);
147 printk(
"nvidia: Backlight unloaded\n");