Date:2012-01-13 00:23:45 (12 years 2 months ago)
Author:Paul Cercueil
Commit:a7bcc4e547fdaad12711ddb99f2f27ae72e2b510
Message:MIPS: JZ4740: SLCD: added a parameter to select the panel.

Files: drivers/video/jz4740_slcd.h (1 diff)
drivers/video/jz4740_slcd_panels.c (3 diffs)

Change Details

drivers/video/jz4740_slcd.h
107107    void (*enable)(struct jzfb *jzfb);
108108    /* deactivate */
109109    void (*disable)(struct jzfb *jzfb);
110    /* panel name */
111    const char *name;
110112};
111113
112114const struct jz_slcd_panel *jz_slcd_panels_probe(struct jzfb *jzfb);
drivers/video/jz4740_slcd_panels.c
2323
2424#include "jz4740_slcd.h"
2525
26static unsigned int jz_slcd_panel = 0;
27
2628/* Send a command without data. */
2729static void send_panel_command(struct jzfb *jzfb, u32 cmd) {
2830    u16 slcd_cfg = readw(jzfb->base + JZ_REG_SLCD_CFG);
...... 
820822    {
821823        ili9325_init, ili9325_exit,
822824        ili9325_enable, ili9325_disable,
825        "ili9325",
823826    },
824827#endif
825828#ifdef CONFIG_JZ_SLCD_ILI9331
826829    {
827830        ili9331_init, ili9331_exit,
828831        ili9331_enable, ili9331_disable,
832        "ili9331",
829833    },
830834#endif
831835#ifdef CONFIG_JZ_SLCD_ILI9338
832836    {
833837        ili9338_init, ili9338_exit,
834838        ili9338_enable, ili9338_disable,
839        "ili9338",
835840    },
836841#endif
837842#ifdef CONFIG_JZ_SLCD_LGDP4551
838843    {
839844        lgdp4551_init, lgdp4551_exit,
840845        lgdp4551_enable, lgdp4551_disable,
846        "lgdp4551",
841847    },
842848#endif
843849#ifdef CONFIG_JZ_SLCD_SPFD5420A
844850    {
845851        spfd5420a_init, spfd5420a_exit,
846852        spfd5420a_enable, spfd5420a_disable,
853        "spfd5420a",
847854    },
848855#endif
849856};
850857
858static int __init jz_slcd_panels_setup(char *this_opt)
859{
860    char *options;
861
862    while ((options = strsep(&this_opt, ",")) != NULL) {
863        if (!strncmp(options, "panel:", 6)) {
864            unsigned int i;
865
866            options += 6;
867            for (i = 0; i < ARRAY_SIZE(jz_slcd_panels); i++) {
868                if (!strcmp(options, jz_slcd_panels[i].name)) {
869                    jz_slcd_panel = i;
870                    break;
871                }
872            }
873
874            continue;
875        }
876    }
877
878    return 0;
879}
880
881__setup("jz_slcd=", jz_slcd_panels_setup);
882
851883const struct jz_slcd_panel *jz_slcd_panels_probe(struct jzfb *jzfb)
852884{
853885    switch (ARRAY_SIZE(jz_slcd_panels)) {
...... 
856888    case 1:
857889        return &jz_slcd_panels[0];
858890    default:
859        dev_warn(&jzfb->pdev->dev,
860            "SLCD panel selection not implemented yet; "
861            "picking first panel\n");
862        return &jz_slcd_panels[0];
891        return &jz_slcd_panels[jz_slcd_panel];
863892    }
864893}

Archive Download the corresponding diff file



interactive