2 * Taal DSI command mode panel
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
22 #include <linux/module.h>
23 #include <linux/delay.h>
24 #include <linux/err.h>
25 #include <linux/jiffies.h>
26 #include <linux/sched.h>
27 #include <linux/backlight.h>
29 #include <linux/interrupt.h>
30 #include <linux/gpio.h>
31 #include <linux/workqueue.h>
32 #include <linux/slab.h>
33 #include <linux/regulator/consumer.h>
34 #include <linux/mutex.h>
36 #include <video/omapdss.h>
37 #include <video/omap-panel-nokia-dsi.h>
39 /* DSI Virtual channel. Hardcoded for now. */
42 #define DCS_READ_NUM_ERRORS 0x05
43 #define DCS_READ_POWER_MODE 0x0a
44 #define DCS_READ_MADCTL 0x0b
45 #define DCS_READ_PIXEL_FORMAT 0x0c
46 #define DCS_RDDSDR 0x0f
47 #define DCS_SLEEP_IN 0x10
48 #define DCS_SLEEP_OUT 0x11
49 #define DCS_DISPLAY_OFF 0x28
50 #define DCS_DISPLAY_ON 0x29
51 #define DCS_COLUMN_ADDR 0x2a
52 #define DCS_PAGE_ADDR 0x2b
53 #define DCS_MEMORY_WRITE 0x2c
54 #define DCS_TEAR_OFF 0x34
55 #define DCS_TEAR_ON 0x35
56 #define DCS_MEM_ACC_CTRL 0x36
57 #define DCS_PIXEL_FORMAT 0x3a
58 #define DCS_BRIGHTNESS 0x51
59 #define DCS_CTRL_DISPLAY 0x53
60 #define DCS_WRITE_CABC 0x55
61 #define DCS_READ_CABC 0x56
62 #define DCS_GET_ID1 0xda
63 #define DCS_GET_ID2 0xdb
64 #define DCS_GET_ID3 0xdc
66 static irqreturn_t
taal_te_isr(int irq
, void *data
);
67 static void taal_te_timeout_work_callback(struct work_struct
*work
);
68 static int _taal_enable_te(struct omap_dss_device
*dssdev
, bool enable
);
70 static int taal_panel_reset(struct omap_dss_device
*dssdev
);
72 struct panel_regulator
{
73 struct regulator
*regulator
;
79 static void free_regulators(struct panel_regulator
*regulators
, int n
)
83 for (i
= 0; i
< n
; i
++) {
84 /* disable/put in reverse order */
85 regulator_disable(regulators
[n
- i
- 1].regulator
);
86 regulator_put(regulators
[n
- i
- 1].regulator
);
90 static int init_regulators(struct omap_dss_device
*dssdev
,
91 struct panel_regulator
*regulators
, int n
)
95 for (i
= 0; i
< n
; i
++) {
96 struct regulator
*reg
;
98 reg
= regulator_get(&dssdev
->dev
, regulators
[i
].name
);
100 dev_err(&dssdev
->dev
, "failed to get regulator %s\n",
106 /* FIXME: better handling of fixed vs. variable regulators */
107 v
= regulator_get_voltage(reg
);
108 if (v
< regulators
[i
].min_uV
|| v
> regulators
[i
].max_uV
) {
109 r
= regulator_set_voltage(reg
, regulators
[i
].min_uV
,
110 regulators
[i
].max_uV
);
112 dev_err(&dssdev
->dev
,
113 "failed to set regulator %s voltage\n",
120 r
= regulator_enable(reg
);
122 dev_err(&dssdev
->dev
, "failed to enable regulator %s\n",
128 regulators
[i
].regulator
= reg
;
134 free_regulators(regulators
, i
);
140 * struct panel_config - panel configuration
143 * @timings: panel resolution
144 * @sleep: various panel specific delays, passed to msleep() if non-zero
145 * @reset_sequence: reset sequence timings, passed to udelay() if non-zero
146 * @regulators: array of panel regulators
147 * @num_regulators: number of regulators in the array
149 struct panel_config
{
153 struct omap_video_timings timings
;
156 unsigned int sleep_in
;
157 unsigned int sleep_out
;
158 unsigned int hw_reset
;
159 unsigned int enable_te
;
167 struct panel_regulator
*regulators
;
175 static struct panel_config panel_configs
[] = {
187 .enable_te
= 100, /* possible panel bug */
199 struct backlight_device
*bldev
;
201 unsigned long hw_guard_end
; /* next value of jiffies when we can
202 * issue the next sleep in/out command
204 unsigned long hw_guard_wait
; /* max guard time in jiffies */
206 struct omap_dss_device
*dssdev
;
223 struct delayed_work te_timeout_work
;
232 struct workqueue_struct
*workqueue
;
234 struct delayed_work esd_work
;
235 unsigned esd_interval
;
238 unsigned ulps_timeout
;
239 struct delayed_work ulps_work
;
241 struct panel_config
*panel_config
;
244 static inline struct nokia_dsi_panel_data
245 *get_panel_data(const struct omap_dss_device
*dssdev
)
247 return (struct nokia_dsi_panel_data
*) dssdev
->data
;
250 static void taal_esd_work(struct work_struct
*work
);
251 static void taal_ulps_work(struct work_struct
*work
);
253 static void hw_guard_start(struct taal_data
*td
, int guard_msec
)
255 td
->hw_guard_wait
= msecs_to_jiffies(guard_msec
);
256 td
->hw_guard_end
= jiffies
+ td
->hw_guard_wait
;
259 static void hw_guard_wait(struct taal_data
*td
)
261 unsigned long wait
= td
->hw_guard_end
- jiffies
;
263 if ((long)wait
> 0 && wait
<= td
->hw_guard_wait
) {
264 set_current_state(TASK_UNINTERRUPTIBLE
);
265 schedule_timeout(wait
);
269 static int taal_dcs_read_1(struct taal_data
*td
, u8 dcs_cmd
, u8
*data
)
274 r
= dsi_vc_dcs_read(td
->dssdev
, td
->channel
, dcs_cmd
, buf
, 1);
284 static int taal_dcs_write_0(struct taal_data
*td
, u8 dcs_cmd
)
286 return dsi_vc_dcs_write(td
->dssdev
, td
->channel
, &dcs_cmd
, 1);
289 static int taal_dcs_write_1(struct taal_data
*td
, u8 dcs_cmd
, u8 param
)
294 return dsi_vc_dcs_write(td
->dssdev
, td
->channel
, buf
, 2);
297 static int taal_sleep_in(struct taal_data
*td
)
306 r
= dsi_vc_dcs_write_nosync(td
->dssdev
, td
->channel
, &cmd
, 1);
310 hw_guard_start(td
, 120);
312 if (td
->panel_config
->sleep
.sleep_in
)
313 msleep(td
->panel_config
->sleep
.sleep_in
);
318 static int taal_sleep_out(struct taal_data
*td
)
324 r
= taal_dcs_write_0(td
, DCS_SLEEP_OUT
);
328 hw_guard_start(td
, 120);
330 if (td
->panel_config
->sleep
.sleep_out
)
331 msleep(td
->panel_config
->sleep
.sleep_out
);
336 static int taal_get_id(struct taal_data
*td
, u8
*id1
, u8
*id2
, u8
*id3
)
340 r
= taal_dcs_read_1(td
, DCS_GET_ID1
, id1
);
343 r
= taal_dcs_read_1(td
, DCS_GET_ID2
, id2
);
346 r
= taal_dcs_read_1(td
, DCS_GET_ID3
, id3
);
353 static int taal_set_addr_mode(struct taal_data
*td
, u8 rotate
, bool mirror
)
359 r
= taal_dcs_read_1(td
, DCS_READ_MADCTL
, &mode
);
390 mode
&= ~((1<<7) | (1<<6) | (1<<5));
391 mode
|= (b7
<< 7) | (b6
<< 6) | (b5
<< 5);
393 return taal_dcs_write_1(td
, DCS_MEM_ACC_CTRL
, mode
);
396 static int taal_set_update_window(struct taal_data
*td
,
397 u16 x
, u16 y
, u16 w
, u16 h
)
406 buf
[0] = DCS_COLUMN_ADDR
;
407 buf
[1] = (x1
>> 8) & 0xff;
408 buf
[2] = (x1
>> 0) & 0xff;
409 buf
[3] = (x2
>> 8) & 0xff;
410 buf
[4] = (x2
>> 0) & 0xff;
412 r
= dsi_vc_dcs_write_nosync(td
->dssdev
, td
->channel
, buf
, sizeof(buf
));
416 buf
[0] = DCS_PAGE_ADDR
;
417 buf
[1] = (y1
>> 8) & 0xff;
418 buf
[2] = (y1
>> 0) & 0xff;
419 buf
[3] = (y2
>> 8) & 0xff;
420 buf
[4] = (y2
>> 0) & 0xff;
422 r
= dsi_vc_dcs_write_nosync(td
->dssdev
, td
->channel
, buf
, sizeof(buf
));
426 dsi_vc_send_bta_sync(td
->dssdev
, td
->channel
);
431 static void taal_queue_esd_work(struct omap_dss_device
*dssdev
)
433 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
435 if (td
->esd_interval
> 0)
436 queue_delayed_work(td
->workqueue
, &td
->esd_work
,
437 msecs_to_jiffies(td
->esd_interval
));
440 static void taal_cancel_esd_work(struct omap_dss_device
*dssdev
)
442 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
444 cancel_delayed_work(&td
->esd_work
);
447 static void taal_queue_ulps_work(struct omap_dss_device
*dssdev
)
449 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
451 if (td
->ulps_timeout
> 0)
452 queue_delayed_work(td
->workqueue
, &td
->ulps_work
,
453 msecs_to_jiffies(td
->ulps_timeout
));
456 static void taal_cancel_ulps_work(struct omap_dss_device
*dssdev
)
458 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
460 cancel_delayed_work(&td
->ulps_work
);
463 static int taal_enter_ulps(struct omap_dss_device
*dssdev
)
465 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
466 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
469 if (td
->ulps_enabled
)
472 taal_cancel_ulps_work(dssdev
);
474 r
= _taal_enable_te(dssdev
, false);
478 disable_irq(gpio_to_irq(panel_data
->ext_te_gpio
));
480 omapdss_dsi_display_disable(dssdev
, false, true);
482 td
->ulps_enabled
= true;
487 dev_err(&dssdev
->dev
, "enter ULPS failed");
488 taal_panel_reset(dssdev
);
490 td
->ulps_enabled
= false;
492 taal_queue_ulps_work(dssdev
);
497 static int taal_exit_ulps(struct omap_dss_device
*dssdev
)
499 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
500 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
503 if (!td
->ulps_enabled
)
506 r
= omapdss_dsi_display_enable(dssdev
);
508 dev_err(&dssdev
->dev
, "failed to enable DSI\n");
512 omapdss_dsi_vc_enable_hs(dssdev
, td
->channel
, true);
514 r
= _taal_enable_te(dssdev
, true);
516 dev_err(&dssdev
->dev
, "failed to re-enable TE");
520 enable_irq(gpio_to_irq(panel_data
->ext_te_gpio
));
522 taal_queue_ulps_work(dssdev
);
524 td
->ulps_enabled
= false;
529 dev_err(&dssdev
->dev
, "failed to exit ULPS");
531 r
= taal_panel_reset(dssdev
);
533 enable_irq(gpio_to_irq(panel_data
->ext_te_gpio
));
534 td
->ulps_enabled
= false;
537 taal_queue_ulps_work(dssdev
);
542 static int taal_wake_up(struct omap_dss_device
*dssdev
)
544 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
546 if (td
->ulps_enabled
)
547 return taal_exit_ulps(dssdev
);
549 taal_cancel_ulps_work(dssdev
);
550 taal_queue_ulps_work(dssdev
);
554 static int taal_bl_update_status(struct backlight_device
*dev
)
556 struct omap_dss_device
*dssdev
= dev_get_drvdata(&dev
->dev
);
557 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
558 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
562 if (dev
->props
.fb_blank
== FB_BLANK_UNBLANK
&&
563 dev
->props
.power
== FB_BLANK_UNBLANK
)
564 level
= dev
->props
.brightness
;
568 dev_dbg(&dssdev
->dev
, "update brightness to %d\n", level
);
570 mutex_lock(&td
->lock
);
572 if (td
->use_dsi_bl
) {
574 dsi_bus_lock(dssdev
);
576 r
= taal_wake_up(dssdev
);
578 r
= taal_dcs_write_1(td
, DCS_BRIGHTNESS
, level
);
580 dsi_bus_unlock(dssdev
);
585 if (!panel_data
->set_backlight
)
588 r
= panel_data
->set_backlight(dssdev
, level
);
591 mutex_unlock(&td
->lock
);
596 static int taal_bl_get_intensity(struct backlight_device
*dev
)
598 if (dev
->props
.fb_blank
== FB_BLANK_UNBLANK
&&
599 dev
->props
.power
== FB_BLANK_UNBLANK
)
600 return dev
->props
.brightness
;
605 static const struct backlight_ops taal_bl_ops
= {
606 .get_brightness
= taal_bl_get_intensity
,
607 .update_status
= taal_bl_update_status
,
610 static void taal_get_timings(struct omap_dss_device
*dssdev
,
611 struct omap_video_timings
*timings
)
613 *timings
= dssdev
->panel
.timings
;
616 static void taal_get_resolution(struct omap_dss_device
*dssdev
,
617 u16
*xres
, u16
*yres
)
619 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
621 if (td
->rotate
== 0 || td
->rotate
== 2) {
622 *xres
= dssdev
->panel
.timings
.x_res
;
623 *yres
= dssdev
->panel
.timings
.y_res
;
625 *yres
= dssdev
->panel
.timings
.x_res
;
626 *xres
= dssdev
->panel
.timings
.y_res
;
630 static ssize_t
taal_num_errors_show(struct device
*dev
,
631 struct device_attribute
*attr
, char *buf
)
633 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
634 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
638 mutex_lock(&td
->lock
);
641 dsi_bus_lock(dssdev
);
643 r
= taal_wake_up(dssdev
);
645 r
= taal_dcs_read_1(td
, DCS_READ_NUM_ERRORS
, &errors
);
647 dsi_bus_unlock(dssdev
);
652 mutex_unlock(&td
->lock
);
657 return snprintf(buf
, PAGE_SIZE
, "%d\n", errors
);
660 static ssize_t
taal_hw_revision_show(struct device
*dev
,
661 struct device_attribute
*attr
, char *buf
)
663 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
664 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
668 mutex_lock(&td
->lock
);
671 dsi_bus_lock(dssdev
);
673 r
= taal_wake_up(dssdev
);
675 r
= taal_get_id(td
, &id1
, &id2
, &id3
);
677 dsi_bus_unlock(dssdev
);
682 mutex_unlock(&td
->lock
);
687 return snprintf(buf
, PAGE_SIZE
, "%02x.%02x.%02x\n", id1
, id2
, id3
);
690 static const char *cabc_modes
[] = {
691 "off", /* used also always when CABC is not supported */
697 static ssize_t
show_cabc_mode(struct device
*dev
,
698 struct device_attribute
*attr
,
701 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
702 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
703 const char *mode_str
;
707 mode
= td
->cabc_mode
;
709 mode_str
= "unknown";
710 if (mode
>= 0 && mode
< ARRAY_SIZE(cabc_modes
))
711 mode_str
= cabc_modes
[mode
];
712 len
= snprintf(buf
, PAGE_SIZE
, "%s\n", mode_str
);
714 return len
< PAGE_SIZE
- 1 ? len
: PAGE_SIZE
- 1;
717 static ssize_t
store_cabc_mode(struct device
*dev
,
718 struct device_attribute
*attr
,
719 const char *buf
, size_t count
)
721 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
722 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
726 for (i
= 0; i
< ARRAY_SIZE(cabc_modes
); i
++) {
727 if (sysfs_streq(cabc_modes
[i
], buf
))
731 if (i
== ARRAY_SIZE(cabc_modes
))
734 mutex_lock(&td
->lock
);
737 dsi_bus_lock(dssdev
);
739 if (!td
->cabc_broken
) {
740 r
= taal_wake_up(dssdev
);
744 r
= taal_dcs_write_1(td
, DCS_WRITE_CABC
, i
);
749 dsi_bus_unlock(dssdev
);
754 mutex_unlock(&td
->lock
);
758 dsi_bus_unlock(dssdev
);
759 mutex_unlock(&td
->lock
);
763 static ssize_t
show_cabc_available_modes(struct device
*dev
,
764 struct device_attribute
*attr
,
771 len
< PAGE_SIZE
&& i
< ARRAY_SIZE(cabc_modes
); i
++)
772 len
+= snprintf(&buf
[len
], PAGE_SIZE
- len
, "%s%s%s",
773 i
? " " : "", cabc_modes
[i
],
774 i
== ARRAY_SIZE(cabc_modes
) - 1 ? "\n" : "");
776 return len
< PAGE_SIZE
? len
: PAGE_SIZE
- 1;
779 static ssize_t
taal_store_esd_interval(struct device
*dev
,
780 struct device_attribute
*attr
,
781 const char *buf
, size_t count
)
783 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
784 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
789 r
= strict_strtoul(buf
, 10, &t
);
793 mutex_lock(&td
->lock
);
794 taal_cancel_esd_work(dssdev
);
795 td
->esd_interval
= t
;
797 taal_queue_esd_work(dssdev
);
798 mutex_unlock(&td
->lock
);
803 static ssize_t
taal_show_esd_interval(struct device
*dev
,
804 struct device_attribute
*attr
,
807 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
808 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
811 mutex_lock(&td
->lock
);
812 t
= td
->esd_interval
;
813 mutex_unlock(&td
->lock
);
815 return snprintf(buf
, PAGE_SIZE
, "%u\n", t
);
818 static ssize_t
taal_store_ulps(struct device
*dev
,
819 struct device_attribute
*attr
,
820 const char *buf
, size_t count
)
822 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
823 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
827 r
= strict_strtoul(buf
, 10, &t
);
831 mutex_lock(&td
->lock
);
834 dsi_bus_lock(dssdev
);
837 r
= taal_enter_ulps(dssdev
);
839 r
= taal_wake_up(dssdev
);
841 dsi_bus_unlock(dssdev
);
844 mutex_unlock(&td
->lock
);
852 static ssize_t
taal_show_ulps(struct device
*dev
,
853 struct device_attribute
*attr
,
856 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
857 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
860 mutex_lock(&td
->lock
);
861 t
= td
->ulps_enabled
;
862 mutex_unlock(&td
->lock
);
864 return snprintf(buf
, PAGE_SIZE
, "%u\n", t
);
867 static ssize_t
taal_store_ulps_timeout(struct device
*dev
,
868 struct device_attribute
*attr
,
869 const char *buf
, size_t count
)
871 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
872 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
876 r
= strict_strtoul(buf
, 10, &t
);
880 mutex_lock(&td
->lock
);
881 td
->ulps_timeout
= t
;
884 /* taal_wake_up will restart the timer */
885 dsi_bus_lock(dssdev
);
886 r
= taal_wake_up(dssdev
);
887 dsi_bus_unlock(dssdev
);
890 mutex_unlock(&td
->lock
);
898 static ssize_t
taal_show_ulps_timeout(struct device
*dev
,
899 struct device_attribute
*attr
,
902 struct omap_dss_device
*dssdev
= to_dss_device(dev
);
903 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
906 mutex_lock(&td
->lock
);
907 t
= td
->ulps_timeout
;
908 mutex_unlock(&td
->lock
);
910 return snprintf(buf
, PAGE_SIZE
, "%u\n", t
);
913 static DEVICE_ATTR(num_dsi_errors
, S_IRUGO
, taal_num_errors_show
, NULL
);
914 static DEVICE_ATTR(hw_revision
, S_IRUGO
, taal_hw_revision_show
, NULL
);
915 static DEVICE_ATTR(cabc_mode
, S_IRUGO
| S_IWUSR
,
916 show_cabc_mode
, store_cabc_mode
);
917 static DEVICE_ATTR(cabc_available_modes
, S_IRUGO
,
918 show_cabc_available_modes
, NULL
);
919 static DEVICE_ATTR(esd_interval
, S_IRUGO
| S_IWUSR
,
920 taal_show_esd_interval
, taal_store_esd_interval
);
921 static DEVICE_ATTR(ulps
, S_IRUGO
| S_IWUSR
,
922 taal_show_ulps
, taal_store_ulps
);
923 static DEVICE_ATTR(ulps_timeout
, S_IRUGO
| S_IWUSR
,
924 taal_show_ulps_timeout
, taal_store_ulps_timeout
);
926 static struct attribute
*taal_attrs
[] = {
927 &dev_attr_num_dsi_errors
.attr
,
928 &dev_attr_hw_revision
.attr
,
929 &dev_attr_cabc_mode
.attr
,
930 &dev_attr_cabc_available_modes
.attr
,
931 &dev_attr_esd_interval
.attr
,
933 &dev_attr_ulps_timeout
.attr
,
937 static struct attribute_group taal_attr_group
= {
941 static void taal_hw_reset(struct omap_dss_device
*dssdev
)
943 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
944 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
946 if (panel_data
->reset_gpio
== -1)
949 gpio_set_value(panel_data
->reset_gpio
, 1);
950 if (td
->panel_config
->reset_sequence
.high
)
951 udelay(td
->panel_config
->reset_sequence
.high
);
952 /* reset the panel */
953 gpio_set_value(panel_data
->reset_gpio
, 0);
955 if (td
->panel_config
->reset_sequence
.low
)
956 udelay(td
->panel_config
->reset_sequence
.low
);
957 gpio_set_value(panel_data
->reset_gpio
, 1);
958 /* wait after releasing reset */
959 if (td
->panel_config
->sleep
.hw_reset
)
960 msleep(td
->panel_config
->sleep
.hw_reset
);
963 static int taal_probe(struct omap_dss_device
*dssdev
)
965 struct backlight_properties props
;
966 struct taal_data
*td
;
967 struct backlight_device
*bldev
;
968 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
969 struct panel_config
*panel_config
= NULL
;
972 dev_dbg(&dssdev
->dev
, "probe\n");
974 if (!panel_data
|| !panel_data
->name
) {
979 for (i
= 0; i
< ARRAY_SIZE(panel_configs
); i
++) {
980 if (strcmp(panel_data
->name
, panel_configs
[i
].name
) == 0) {
981 panel_config
= &panel_configs
[i
];
991 dssdev
->panel
.config
= OMAP_DSS_LCD_TFT
;
992 dssdev
->panel
.timings
= panel_config
->timings
;
993 dssdev
->ctrl
.pixel_size
= 24;
995 td
= kzalloc(sizeof(*td
), GFP_KERNEL
);
1000 td
->dssdev
= dssdev
;
1001 td
->panel_config
= panel_config
;
1002 td
->esd_interval
= panel_data
->esd_interval
;
1003 td
->ulps_enabled
= false;
1004 td
->ulps_timeout
= panel_data
->ulps_timeout
;
1006 mutex_init(&td
->lock
);
1008 atomic_set(&td
->do_update
, 0);
1010 r
= init_regulators(dssdev
, panel_config
->regulators
,
1011 panel_config
->num_regulators
);
1015 td
->workqueue
= create_singlethread_workqueue("taal_esd");
1016 if (td
->workqueue
== NULL
) {
1017 dev_err(&dssdev
->dev
, "can't create ESD workqueue\n");
1021 INIT_DELAYED_WORK_DEFERRABLE(&td
->esd_work
, taal_esd_work
);
1022 INIT_DELAYED_WORK(&td
->ulps_work
, taal_ulps_work
);
1024 dev_set_drvdata(&dssdev
->dev
, td
);
1026 taal_hw_reset(dssdev
);
1028 /* if no platform set_backlight() defined, presume DSI backlight
1030 memset(&props
, 0, sizeof(struct backlight_properties
));
1031 if (!panel_data
->set_backlight
)
1032 td
->use_dsi_bl
= true;
1035 props
.max_brightness
= 255;
1037 props
.max_brightness
= 127;
1039 props
.type
= BACKLIGHT_RAW
;
1040 bldev
= backlight_device_register(dev_name(&dssdev
->dev
), &dssdev
->dev
,
1041 dssdev
, &taal_bl_ops
, &props
);
1042 if (IS_ERR(bldev
)) {
1049 bldev
->props
.fb_blank
= FB_BLANK_UNBLANK
;
1050 bldev
->props
.power
= FB_BLANK_UNBLANK
;
1052 bldev
->props
.brightness
= 255;
1054 bldev
->props
.brightness
= 127;
1056 taal_bl_update_status(bldev
);
1058 if (panel_data
->use_ext_te
) {
1059 int gpio
= panel_data
->ext_te_gpio
;
1061 r
= gpio_request(gpio
, "taal irq");
1063 dev_err(&dssdev
->dev
, "GPIO request failed\n");
1067 gpio_direction_input(gpio
);
1069 r
= request_irq(gpio_to_irq(gpio
), taal_te_isr
,
1070 IRQF_DISABLED
| IRQF_TRIGGER_RISING
,
1071 "taal vsync", dssdev
);
1074 dev_err(&dssdev
->dev
, "IRQ request failed\n");
1079 INIT_DELAYED_WORK_DEFERRABLE(&td
->te_timeout_work
,
1080 taal_te_timeout_work_callback
);
1082 dev_dbg(&dssdev
->dev
, "Using GPIO TE\n");
1085 r
= omap_dsi_request_vc(dssdev
, &td
->channel
);
1087 dev_err(&dssdev
->dev
, "failed to get virtual channel\n");
1091 r
= omap_dsi_set_vc_id(dssdev
, td
->channel
, TCH
);
1093 dev_err(&dssdev
->dev
, "failed to set VC_ID\n");
1097 r
= sysfs_create_group(&dssdev
->dev
.kobj
, &taal_attr_group
);
1099 dev_err(&dssdev
->dev
, "failed to create sysfs files\n");
1106 omap_dsi_release_vc(dssdev
, td
->channel
);
1108 if (panel_data
->use_ext_te
)
1109 free_irq(gpio_to_irq(panel_data
->ext_te_gpio
), dssdev
);
1111 if (panel_data
->use_ext_te
)
1112 gpio_free(panel_data
->ext_te_gpio
);
1114 backlight_device_unregister(bldev
);
1116 destroy_workqueue(td
->workqueue
);
1118 free_regulators(panel_config
->regulators
, panel_config
->num_regulators
);
1125 static void __exit
taal_remove(struct omap_dss_device
*dssdev
)
1127 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1128 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
1129 struct backlight_device
*bldev
;
1131 dev_dbg(&dssdev
->dev
, "remove\n");
1133 sysfs_remove_group(&dssdev
->dev
.kobj
, &taal_attr_group
);
1134 omap_dsi_release_vc(dssdev
, td
->channel
);
1136 if (panel_data
->use_ext_te
) {
1137 int gpio
= panel_data
->ext_te_gpio
;
1138 free_irq(gpio_to_irq(gpio
), dssdev
);
1143 bldev
->props
.power
= FB_BLANK_POWERDOWN
;
1144 taal_bl_update_status(bldev
);
1145 backlight_device_unregister(bldev
);
1147 taal_cancel_ulps_work(dssdev
);
1148 taal_cancel_esd_work(dssdev
);
1149 destroy_workqueue(td
->workqueue
);
1151 /* reset, to be sure that the panel is in a valid state */
1152 taal_hw_reset(dssdev
);
1154 free_regulators(td
->panel_config
->regulators
,
1155 td
->panel_config
->num_regulators
);
1160 static int taal_power_on(struct omap_dss_device
*dssdev
)
1162 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1166 r
= omapdss_dsi_display_enable(dssdev
);
1168 dev_err(&dssdev
->dev
, "failed to enable DSI\n");
1172 taal_hw_reset(dssdev
);
1174 omapdss_dsi_vc_enable_hs(dssdev
, td
->channel
, false);
1176 r
= taal_sleep_out(td
);
1180 r
= taal_get_id(td
, &id1
, &id2
, &id3
);
1184 /* on early Taal revisions CABC is broken */
1185 if (td
->panel_config
->type
== PANEL_TAAL
&&
1186 (id2
== 0x00 || id2
== 0xff || id2
== 0x81))
1187 td
->cabc_broken
= true;
1189 r
= taal_dcs_write_1(td
, DCS_BRIGHTNESS
, 0xff);
1193 r
= taal_dcs_write_1(td
, DCS_CTRL_DISPLAY
,
1194 (1<<2) | (1<<5)); /* BL | BCTRL */
1198 r
= taal_dcs_write_1(td
, DCS_PIXEL_FORMAT
, 0x7); /* 24bit/pixel */
1202 r
= taal_set_addr_mode(td
, td
->rotate
, td
->mirror
);
1206 if (!td
->cabc_broken
) {
1207 r
= taal_dcs_write_1(td
, DCS_WRITE_CABC
, td
->cabc_mode
);
1212 r
= taal_dcs_write_0(td
, DCS_DISPLAY_ON
);
1216 r
= _taal_enable_te(dssdev
, td
->te_enabled
);
1222 if (!td
->intro_printed
) {
1223 dev_info(&dssdev
->dev
, "%s panel revision %02x.%02x.%02x\n",
1224 td
->panel_config
->name
, id1
, id2
, id3
);
1225 if (td
->cabc_broken
)
1226 dev_info(&dssdev
->dev
,
1227 "old Taal version, CABC disabled\n");
1228 td
->intro_printed
= true;
1231 omapdss_dsi_vc_enable_hs(dssdev
, td
->channel
, true);
1235 dev_err(&dssdev
->dev
, "error while enabling panel, issuing HW reset\n");
1237 taal_hw_reset(dssdev
);
1239 omapdss_dsi_display_disable(dssdev
, true, false);
1244 static void taal_power_off(struct omap_dss_device
*dssdev
)
1246 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1249 r
= taal_dcs_write_0(td
, DCS_DISPLAY_OFF
);
1251 r
= taal_sleep_in(td
);
1254 dev_err(&dssdev
->dev
,
1255 "error disabling panel, issuing HW reset\n");
1256 taal_hw_reset(dssdev
);
1259 omapdss_dsi_display_disable(dssdev
, true, false);
1264 static int taal_panel_reset(struct omap_dss_device
*dssdev
)
1266 dev_err(&dssdev
->dev
, "performing LCD reset\n");
1268 taal_power_off(dssdev
);
1269 taal_hw_reset(dssdev
);
1270 return taal_power_on(dssdev
);
1273 static int taal_enable(struct omap_dss_device
*dssdev
)
1275 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1278 dev_dbg(&dssdev
->dev
, "enable\n");
1280 mutex_lock(&td
->lock
);
1282 if (dssdev
->state
!= OMAP_DSS_DISPLAY_DISABLED
) {
1287 dsi_bus_lock(dssdev
);
1289 r
= taal_power_on(dssdev
);
1291 dsi_bus_unlock(dssdev
);
1296 taal_queue_esd_work(dssdev
);
1298 dssdev
->state
= OMAP_DSS_DISPLAY_ACTIVE
;
1300 mutex_unlock(&td
->lock
);
1304 dev_dbg(&dssdev
->dev
, "enable failed\n");
1305 mutex_unlock(&td
->lock
);
1309 static void taal_disable(struct omap_dss_device
*dssdev
)
1311 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1313 dev_dbg(&dssdev
->dev
, "disable\n");
1315 mutex_lock(&td
->lock
);
1317 taal_cancel_ulps_work(dssdev
);
1318 taal_cancel_esd_work(dssdev
);
1320 dsi_bus_lock(dssdev
);
1322 if (dssdev
->state
== OMAP_DSS_DISPLAY_ACTIVE
) {
1325 r
= taal_wake_up(dssdev
);
1327 taal_power_off(dssdev
);
1330 dsi_bus_unlock(dssdev
);
1332 dssdev
->state
= OMAP_DSS_DISPLAY_DISABLED
;
1334 mutex_unlock(&td
->lock
);
1337 static int taal_suspend(struct omap_dss_device
*dssdev
)
1339 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1342 dev_dbg(&dssdev
->dev
, "suspend\n");
1344 mutex_lock(&td
->lock
);
1346 if (dssdev
->state
!= OMAP_DSS_DISPLAY_ACTIVE
) {
1351 taal_cancel_ulps_work(dssdev
);
1352 taal_cancel_esd_work(dssdev
);
1354 dsi_bus_lock(dssdev
);
1356 r
= taal_wake_up(dssdev
);
1358 taal_power_off(dssdev
);
1360 dsi_bus_unlock(dssdev
);
1362 dssdev
->state
= OMAP_DSS_DISPLAY_SUSPENDED
;
1364 mutex_unlock(&td
->lock
);
1368 mutex_unlock(&td
->lock
);
1372 static int taal_resume(struct omap_dss_device
*dssdev
)
1374 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1377 dev_dbg(&dssdev
->dev
, "resume\n");
1379 mutex_lock(&td
->lock
);
1381 if (dssdev
->state
!= OMAP_DSS_DISPLAY_SUSPENDED
) {
1386 dsi_bus_lock(dssdev
);
1388 r
= taal_power_on(dssdev
);
1390 dsi_bus_unlock(dssdev
);
1393 dssdev
->state
= OMAP_DSS_DISPLAY_DISABLED
;
1395 dssdev
->state
= OMAP_DSS_DISPLAY_ACTIVE
;
1396 taal_queue_esd_work(dssdev
);
1399 mutex_unlock(&td
->lock
);
1403 mutex_unlock(&td
->lock
);
1407 static void taal_framedone_cb(int err
, void *data
)
1409 struct omap_dss_device
*dssdev
= data
;
1410 dev_dbg(&dssdev
->dev
, "framedone, err %d\n", err
);
1411 dsi_bus_unlock(dssdev
);
1414 static irqreturn_t
taal_te_isr(int irq
, void *data
)
1416 struct omap_dss_device
*dssdev
= data
;
1417 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1421 old
= atomic_cmpxchg(&td
->do_update
, 1, 0);
1424 cancel_delayed_work(&td
->te_timeout_work
);
1426 r
= omap_dsi_update(dssdev
, td
->channel
,
1427 td
->update_region
.x
,
1428 td
->update_region
.y
,
1429 td
->update_region
.w
,
1430 td
->update_region
.h
,
1431 taal_framedone_cb
, dssdev
);
1438 dev_err(&dssdev
->dev
, "start update failed\n");
1439 dsi_bus_unlock(dssdev
);
1443 static void taal_te_timeout_work_callback(struct work_struct
*work
)
1445 struct taal_data
*td
= container_of(work
, struct taal_data
,
1446 te_timeout_work
.work
);
1447 struct omap_dss_device
*dssdev
= td
->dssdev
;
1449 dev_err(&dssdev
->dev
, "TE not received for 250ms!\n");
1451 atomic_set(&td
->do_update
, 0);
1452 dsi_bus_unlock(dssdev
);
1455 static int taal_update(struct omap_dss_device
*dssdev
,
1456 u16 x
, u16 y
, u16 w
, u16 h
)
1458 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1459 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
1462 dev_dbg(&dssdev
->dev
, "update %d, %d, %d x %d\n", x
, y
, w
, h
);
1464 mutex_lock(&td
->lock
);
1465 dsi_bus_lock(dssdev
);
1467 r
= taal_wake_up(dssdev
);
1476 r
= omap_dsi_prepare_update(dssdev
, &x
, &y
, &w
, &h
, true);
1480 r
= taal_set_update_window(td
, x
, y
, w
, h
);
1484 if (td
->te_enabled
&& panel_data
->use_ext_te
) {
1485 td
->update_region
.x
= x
;
1486 td
->update_region
.y
= y
;
1487 td
->update_region
.w
= w
;
1488 td
->update_region
.h
= h
;
1490 schedule_delayed_work(&td
->te_timeout_work
,
1491 msecs_to_jiffies(250));
1492 atomic_set(&td
->do_update
, 1);
1494 r
= omap_dsi_update(dssdev
, td
->channel
, x
, y
, w
, h
,
1495 taal_framedone_cb
, dssdev
);
1500 /* note: no bus_unlock here. unlock is in framedone_cb */
1501 mutex_unlock(&td
->lock
);
1504 dsi_bus_unlock(dssdev
);
1505 mutex_unlock(&td
->lock
);
1509 static int taal_sync(struct omap_dss_device
*dssdev
)
1511 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1513 dev_dbg(&dssdev
->dev
, "sync\n");
1515 mutex_lock(&td
->lock
);
1516 dsi_bus_lock(dssdev
);
1517 dsi_bus_unlock(dssdev
);
1518 mutex_unlock(&td
->lock
);
1520 dev_dbg(&dssdev
->dev
, "sync done\n");
1525 static int _taal_enable_te(struct omap_dss_device
*dssdev
, bool enable
)
1527 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1528 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
1532 r
= taal_dcs_write_1(td
, DCS_TEAR_ON
, 0);
1534 r
= taal_dcs_write_0(td
, DCS_TEAR_OFF
);
1536 if (!panel_data
->use_ext_te
)
1537 omapdss_dsi_enable_te(dssdev
, enable
);
1539 if (td
->panel_config
->sleep
.enable_te
)
1540 msleep(td
->panel_config
->sleep
.enable_te
);
1545 static int taal_enable_te(struct omap_dss_device
*dssdev
, bool enable
)
1547 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1550 mutex_lock(&td
->lock
);
1552 if (td
->te_enabled
== enable
)
1555 dsi_bus_lock(dssdev
);
1558 r
= taal_wake_up(dssdev
);
1562 r
= _taal_enable_te(dssdev
, enable
);
1567 td
->te_enabled
= enable
;
1569 dsi_bus_unlock(dssdev
);
1571 mutex_unlock(&td
->lock
);
1575 dsi_bus_unlock(dssdev
);
1576 mutex_unlock(&td
->lock
);
1581 static int taal_get_te(struct omap_dss_device
*dssdev
)
1583 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1586 mutex_lock(&td
->lock
);
1588 mutex_unlock(&td
->lock
);
1593 static int taal_rotate(struct omap_dss_device
*dssdev
, u8 rotate
)
1595 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1598 dev_dbg(&dssdev
->dev
, "rotate %d\n", rotate
);
1600 mutex_lock(&td
->lock
);
1602 if (td
->rotate
== rotate
)
1605 dsi_bus_lock(dssdev
);
1608 r
= taal_wake_up(dssdev
);
1612 r
= taal_set_addr_mode(td
, rotate
, td
->mirror
);
1617 td
->rotate
= rotate
;
1619 dsi_bus_unlock(dssdev
);
1621 mutex_unlock(&td
->lock
);
1624 dsi_bus_unlock(dssdev
);
1625 mutex_unlock(&td
->lock
);
1629 static u8
taal_get_rotate(struct omap_dss_device
*dssdev
)
1631 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1634 mutex_lock(&td
->lock
);
1636 mutex_unlock(&td
->lock
);
1641 static int taal_mirror(struct omap_dss_device
*dssdev
, bool enable
)
1643 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1646 dev_dbg(&dssdev
->dev
, "mirror %d\n", enable
);
1648 mutex_lock(&td
->lock
);
1650 if (td
->mirror
== enable
)
1653 dsi_bus_lock(dssdev
);
1655 r
= taal_wake_up(dssdev
);
1659 r
= taal_set_addr_mode(td
, td
->rotate
, enable
);
1664 td
->mirror
= enable
;
1666 dsi_bus_unlock(dssdev
);
1668 mutex_unlock(&td
->lock
);
1671 dsi_bus_unlock(dssdev
);
1672 mutex_unlock(&td
->lock
);
1676 static bool taal_get_mirror(struct omap_dss_device
*dssdev
)
1678 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1681 mutex_lock(&td
->lock
);
1683 mutex_unlock(&td
->lock
);
1688 static int taal_run_test(struct omap_dss_device
*dssdev
, int test_num
)
1690 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1694 mutex_lock(&td
->lock
);
1701 dsi_bus_lock(dssdev
);
1703 r
= taal_wake_up(dssdev
);
1707 r
= taal_dcs_read_1(td
, DCS_GET_ID1
, &id1
);
1710 r
= taal_dcs_read_1(td
, DCS_GET_ID2
, &id2
);
1713 r
= taal_dcs_read_1(td
, DCS_GET_ID3
, &id3
);
1717 dsi_bus_unlock(dssdev
);
1718 mutex_unlock(&td
->lock
);
1721 dsi_bus_unlock(dssdev
);
1723 mutex_unlock(&td
->lock
);
1727 static int taal_memory_read(struct omap_dss_device
*dssdev
,
1728 void *buf
, size_t size
,
1729 u16 x
, u16 y
, u16 w
, u16 h
)
1734 unsigned buf_used
= 0;
1735 struct taal_data
*td
= dev_get_drvdata(&dssdev
->dev
);
1737 if (size
< w
* h
* 3)
1740 mutex_lock(&td
->lock
);
1747 size
= min(w
* h
* 3,
1748 dssdev
->panel
.timings
.x_res
*
1749 dssdev
->panel
.timings
.y_res
* 3);
1751 dsi_bus_lock(dssdev
);
1753 r
= taal_wake_up(dssdev
);
1757 /* plen 1 or 2 goes into short packet. until checksum error is fixed,
1758 * use short packets. plen 32 works, but bigger packets seem to cause
1765 taal_set_update_window(td
, x
, y
, w
, h
);
1767 r
= dsi_vc_set_max_rx_packet_size(dssdev
, td
->channel
, plen
);
1771 while (buf_used
< size
) {
1772 u8 dcs_cmd
= first
? 0x2e : 0x3e;
1775 r
= dsi_vc_dcs_read(dssdev
, td
->channel
, dcs_cmd
,
1776 buf
+ buf_used
, size
- buf_used
);
1779 dev_err(&dssdev
->dev
, "read error\n");
1786 dev_err(&dssdev
->dev
, "short read\n");
1790 if (signal_pending(current
)) {
1791 dev_err(&dssdev
->dev
, "signal pending, "
1792 "aborting memory read\n");
1801 dsi_vc_set_max_rx_packet_size(dssdev
, td
->channel
, 1);
1803 dsi_bus_unlock(dssdev
);
1805 mutex_unlock(&td
->lock
);
1809 static void taal_ulps_work(struct work_struct
*work
)
1811 struct taal_data
*td
= container_of(work
, struct taal_data
,
1813 struct omap_dss_device
*dssdev
= td
->dssdev
;
1815 mutex_lock(&td
->lock
);
1817 if (dssdev
->state
!= OMAP_DSS_DISPLAY_ACTIVE
|| !td
->enabled
) {
1818 mutex_unlock(&td
->lock
);
1822 dsi_bus_lock(dssdev
);
1824 taal_enter_ulps(dssdev
);
1826 dsi_bus_unlock(dssdev
);
1827 mutex_unlock(&td
->lock
);
1830 static void taal_esd_work(struct work_struct
*work
)
1832 struct taal_data
*td
= container_of(work
, struct taal_data
,
1834 struct omap_dss_device
*dssdev
= td
->dssdev
;
1835 struct nokia_dsi_panel_data
*panel_data
= get_panel_data(dssdev
);
1839 mutex_lock(&td
->lock
);
1842 mutex_unlock(&td
->lock
);
1846 dsi_bus_lock(dssdev
);
1848 r
= taal_wake_up(dssdev
);
1850 dev_err(&dssdev
->dev
, "failed to exit ULPS\n");
1854 r
= taal_dcs_read_1(td
, DCS_RDDSDR
, &state1
);
1856 dev_err(&dssdev
->dev
, "failed to read Taal status\n");
1860 /* Run self diagnostics */
1861 r
= taal_sleep_out(td
);
1863 dev_err(&dssdev
->dev
, "failed to run Taal self-diagnostics\n");
1867 r
= taal_dcs_read_1(td
, DCS_RDDSDR
, &state2
);
1869 dev_err(&dssdev
->dev
, "failed to read Taal status\n");
1873 /* Each sleep out command will trigger a self diagnostic and flip
1874 * Bit6 if the test passes.
1876 if (!((state1
^ state2
) & (1 << 6))) {
1877 dev_err(&dssdev
->dev
, "LCD self diagnostics failed\n");
1880 /* Self-diagnostics result is also shown on TE GPIO line. We need
1881 * to re-enable TE after self diagnostics */
1882 if (td
->te_enabled
&& panel_data
->use_ext_te
) {
1883 r
= taal_dcs_write_1(td
, DCS_TEAR_ON
, 0);
1888 dsi_bus_unlock(dssdev
);
1890 taal_queue_esd_work(dssdev
);
1892 mutex_unlock(&td
->lock
);
1895 dev_err(&dssdev
->dev
, "performing LCD reset\n");
1897 taal_panel_reset(dssdev
);
1899 dsi_bus_unlock(dssdev
);
1901 taal_queue_esd_work(dssdev
);
1903 mutex_unlock(&td
->lock
);
1906 static struct omap_dss_driver taal_driver
= {
1907 .probe
= taal_probe
,
1908 .remove
= __exit_p(taal_remove
),
1910 .enable
= taal_enable
,
1911 .disable
= taal_disable
,
1912 .suspend
= taal_suspend
,
1913 .resume
= taal_resume
,
1915 .update
= taal_update
,
1918 .get_resolution
= taal_get_resolution
,
1919 .get_recommended_bpp
= omapdss_default_get_recommended_bpp
,
1921 .enable_te
= taal_enable_te
,
1922 .get_te
= taal_get_te
,
1924 .set_rotate
= taal_rotate
,
1925 .get_rotate
= taal_get_rotate
,
1926 .set_mirror
= taal_mirror
,
1927 .get_mirror
= taal_get_mirror
,
1928 .run_test
= taal_run_test
,
1929 .memory_read
= taal_memory_read
,
1931 .get_timings
= taal_get_timings
,
1935 .owner
= THIS_MODULE
,
1939 static int __init
taal_init(void)
1941 omap_dss_register_driver(&taal_driver
);
1946 static void __exit
taal_exit(void)
1948 omap_dss_unregister_driver(&taal_driver
);
1951 module_init(taal_init
);
1952 module_exit(taal_exit
);
1954 MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
1955 MODULE_DESCRIPTION("Taal Driver");
1956 MODULE_LICENSE("GPL");