30 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
32 #include <linux/module.h>
33 #include <linux/kernel.h>
40 #include <linux/pci.h>
41 #include <linux/slab.h>
47 #define CRVML_DEVICE_LPC 0x27B8
48 #define CRVML_REG_GPIOBAR 0x48
49 #define CRVML_REG_GPIOEN 0x4C
50 #define CRVML_GPIOEN_BIT (1 << 4)
51 #define CRVML_PANEL_PORT 0x38
52 #define CRVML_LVDS_ON 0x00000001
53 #define CRVML_PANEL_ON 0x00000002
54 #define CRVML_BACKLIGHT_OFF 0x00000004
57 #define CRVML_DEVICE_MCH 0x5001
58 #define CRVML_REG_MCHBAR 0x44
59 #define CRVML_REG_MCHEN 0x54
60 #define CRVML_MCHEN_BIT (1 << 28)
61 #define CRVML_MCHMAP_SIZE 4096
62 #define CRVML_REG_CLOCK 0xc3c
63 #define CRVML_CLOCK_SHIFT 8
64 #define CRVML_CLOCK_MASK 0x00000f00
76 int intensity = bd->
props.brightness;
115 .get_brightness = cr_backlight_get_intensity,
116 .update_status = cr_backlight_set_intensity,
119 static void cr_panel_on(
void)
126 if (cur & 0x00000001) {
140 outl(cur | CRVML_LVDS_ON, addr);
144 static void cr_panel_off(
void)
151 cur &= ~CRVML_LVDS_ON;
154 if (cur & CRVML_PANEL_ON) {
156 outl(cur & ~CRVML_PANEL_ON, addr);
160 static int cr_lcd_set_power(
struct lcd_device *
ld,
int power)
170 static struct lcd_ops cr_lcd_ops = {
171 .set_power = cr_lcd_set_power,
185 pr_err(
"INTEL CARILLO RANCH LPC not found.\n");
191 pr_err(
"Carillo Ranch GPIO device was not enabled.\n");
199 &cr_backlight_ops, &props);
231 platform_set_drvdata(pdev, crp);
238 struct cr_panel *crp = platform_get_drvdata(pdev);
252 .probe = cr_backlight_probe,
253 .remove = cr_backlight_remove,
255 .name =
"cr_backlight",
261 static int __init cr_backlight_init(
void)
268 crp = platform_device_register_simple(
"cr_backlight", -1,
NULL, 0);
274 pr_info(
"Carillo Ranch Backlight Driver Initialized.\n");
279 static void __exit cr_backlight_exit(
void)