diff --git a/sys/arm/ti/am335x/am335x_lcd.c b/sys/arm/ti/am335x/am335x_lcd.c --- a/sys/arm/ti/am335x/am335x_lcd.c +++ b/sys/arm/ti/am335x/am335x_lcd.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -69,7 +68,6 @@ #include #include "am335x_lcd.h" -#include "am335x_pwm.h" #include "fb_if.h" #include "crtc_if.h" @@ -183,10 +181,6 @@ #define LCD_WRITE4(_sc, reg, value) \ bus_write_4((_sc)->sc_mem_res, reg, value); -/* Backlight is controlled by eCAS interface on PWM unit 0 */ -#define PWM_UNIT 0 -#define PWM_PERIOD 100 - #define MODE_HBP(mode) ((mode)->htotal - (mode)->hsync_end) #define MODE_HFP(mode) ((mode)->hsync_start - (mode)->hdisplay) #define MODE_HSW(mode) ((mode)->hsync_end - (mode)->hsync_start) @@ -204,8 +198,6 @@ struct resource *sc_irq_res; void *sc_intr_hl; struct mtx sc_mtx; - int sc_backlight; - struct sysctl_oid *sc_oid; struct panel_info sc_panel; @@ -257,34 +249,6 @@ return (div); } -static int -am335x_lcd_sysctl_backlight(SYSCTL_HANDLER_ARGS) -{ - struct am335x_lcd_softc *sc = (struct am335x_lcd_softc*)arg1; - int error; - int backlight; - - backlight = sc->sc_backlight; - error = sysctl_handle_int(oidp, &backlight, 0, req); - - if (error != 0 || req->newptr == NULL) - return (error); - - if (backlight < 0) - backlight = 0; - if (backlight > 100) - backlight = 100; - - LCD_LOCK(sc); - error = am335x_pwm_config_ecap(PWM_UNIT, PWM_PERIOD, - backlight*PWM_PERIOD/100); - if (error == 0) - sc->sc_backlight = backlight; - LCD_UNLOCK(sc); - - return (error); -} - static uint32_t am335x_mode_vrefresh(const struct videomode *mode) { @@ -958,8 +922,6 @@ int err; int rid; - struct sysctl_ctx_list *ctx; - struct sysctl_oid *tree; phandle_t root, panel_node; err = 0; @@ -991,7 +953,6 @@ panel_node = fdt_find_compatible(root, "ti,tilcdc,panel", 1); if (panel_node != 0) { - device_printf(dev, "using static panel info\n"); if (am335x_read_panel_info(dev, panel_node, &sc->sc_panel)) { device_printf(dev, "failed to read panel info\n"); return (ENXIO); @@ -1039,18 +1000,6 @@ LCD_LOCK_INIT(sc); - /* Init backlight interface */ - ctx = device_get_sysctl_ctx(sc->sc_dev); - tree = device_get_sysctl_tree(sc->sc_dev); - sc->sc_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "backlight", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, - am335x_lcd_sysctl_backlight, "I", "LCD backlight"); - sc->sc_backlight = 0; - /* Check if eCAS interface is available at this point */ - if (am335x_pwm_config_ecap(PWM_UNIT, - PWM_PERIOD, PWM_PERIOD) == 0) - sc->sc_backlight = 100; - if (panel_node != 0) am335x_lcd_configure(sc); else