linux/include/video/auo_k190xfb.h
<<
>>
Prefs
   1/*
   2 * Definitions for AUO-K190X framebuffer drivers
   3 *
   4 * Copyright (C) 2012 Heiko Stuebner <heiko@sntech.de>
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License version 2 as
   8 * published by the Free Software Foundation.
   9 */
  10
  11#ifndef _LINUX_VIDEO_AUO_K190XFB_H_
  12#define _LINUX_VIDEO_AUO_K190XFB_H_
  13
  14/* Controller standby command needs a param */
  15#define AUOK190X_QUIRK_STANDBYPARAM     (1 << 0)
  16
  17/* Controller standby is completely broken */
  18#define AUOK190X_QUIRK_STANDBYBROKEN    (1 << 1)
  19
  20/*
  21 * Resolutions for the displays
  22 */
  23#define AUOK190X_RESOLUTION_800_600             0
  24#define AUOK190X_RESOLUTION_1024_768            1
  25#define AUOK190X_RESOLUTION_600_800             4
  26#define AUOK190X_RESOLUTION_768_1024            5
  27
  28/*
  29 * struct used by auok190x. board specific stuff comes from *board
  30 */
  31struct auok190xfb_par {
  32        struct fb_info *info;
  33        struct auok190x_board *board;
  34
  35        struct regulator *regulator;
  36
  37        struct mutex io_lock;
  38        struct delayed_work work;
  39        wait_queue_head_t waitq;
  40        int resolution;
  41        int rotation;
  42        int consecutive_threshold;
  43        int update_cnt;
  44
  45        /* panel and controller informations */
  46        int epd_type;
  47        int panel_size_int;
  48        int panel_size_float;
  49        int panel_model;
  50        int tcon_version;
  51        int lut_version;
  52
  53        /* individual controller callbacks */
  54        void (*update_partial)(struct auok190xfb_par *par, u16 y1, u16 y2);
  55        void (*update_all)(struct auok190xfb_par *par);
  56        bool (*need_refresh)(struct auok190xfb_par *par);
  57        void (*init)(struct auok190xfb_par *par);
  58        void (*recover)(struct auok190xfb_par *par);
  59
  60        int update_mode; /* mode to use for updates */
  61        int last_mode; /* update mode last used */
  62        int flash;
  63
  64        /* power management */
  65        int autosuspend_delay;
  66        bool standby;
  67        bool manual_standby;
  68};
  69
  70/**
  71 * Board specific platform-data
  72 * @init:               initialize the controller interface
  73 * @cleanup:            cleanup the controller interface
  74 * @wait_for_rdy:       wait until the controller is not busy anymore
  75 * @set_ctl:            change an interface control
  76 * @set_hdb:            write a value to the data register
  77 * @get_hdb:            read a value from the data register
  78 * @setup_irq:          method to setup the irq handling on the busy gpio
  79 * @gpio_nsleep:        sleep gpio
  80 * @gpio_nrst:          reset gpio
  81 * @gpio_nbusy:         busy gpio
  82 * @resolution:         one of the AUOK190X_RESOLUTION constants
  83 * @rotation:           rotation of the framebuffer
  84 * @quirks:             controller quirks to honor
  85 * @fps:                frames per second for defio
  86 */
  87struct auok190x_board {
  88        int (*init)(struct auok190xfb_par *);
  89        void (*cleanup)(struct auok190xfb_par *);
  90        int (*wait_for_rdy)(struct auok190xfb_par *);
  91
  92        void (*set_ctl)(struct auok190xfb_par *, unsigned char, u8);
  93        void (*set_hdb)(struct auok190xfb_par *, u16);
  94        u16 (*get_hdb)(struct auok190xfb_par *);
  95
  96        int (*setup_irq)(struct fb_info *);
  97
  98        int gpio_nsleep;
  99        int gpio_nrst;
 100        int gpio_nbusy;
 101
 102        int resolution;
 103        int quirks;
 104        int fps;
 105};
 106
 107#endif
 108