Lines Matching +full:te +full:- +full:irq +full:- +full:pins
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 2004-2005 Nokia Corporation
61 /* Reserve 4 request slots for requests in irq context */
139 hwa742.extif->set_bits_per_cycle(8); in hwa742_read_reg()
140 hwa742.extif->write_command(®, 1); in hwa742_read_reg()
141 hwa742.extif->read_data(&data, 1); in hwa742_read_reg()
148 hwa742.extif->set_bits_per_cycle(8); in hwa742_write_reg()
149 hwa742.extif->write_command(®, 1); in hwa742_write_reg()
150 hwa742.extif->write_data(&data, 1); in hwa742_write_reg()
158 x_end--; in set_window_regs()
159 y_end--; in set_window_regs()
169 hwa742.extif->set_bits_per_cycle(8); in set_window_regs()
172 hwa742.extif->write_command(&cmd, 1); in set_window_regs()
174 hwa742.extif->write_data(tmp, 8); in set_window_regs()
182 dev_dbg(hwa742.fbdev->dev, "hwa742: enabled pixel doubling\n"); in set_format_regs()
187 dev_dbg(hwa742.fbdev->dev, "hwa742: disabled pixel doubling\n"); in set_format_regs()
206 hwa742.extif->enable_tearsync(1, 0); in enable_tearsync()
211 hwa742.extif->enable_tearsync(1, 0); in enable_tearsync()
217 hwa742.extif->enable_tearsync(1, 0); in enable_tearsync()
221 hwa742.extif->enable_tearsync(1, y + 1); in enable_tearsync()
228 hwa742.extif->enable_tearsync(0, 0); in disable_tearsync()
250 list_del(&req->entry); in alloc_req()
253 INIT_LIST_HEAD(&req->entry); in alloc_req()
254 req->flags = req_flags; in alloc_req()
265 list_move(&req->entry, &hwa742.free_req_list); in free_req()
266 if (!(req->flags & REQ_FROM_IRQ_POOL)) in free_req()
287 if (req->handler(req) == REQ_PENDING) in process_pending_requests()
290 complete = req->complete; in process_pending_requests()
291 complete_data = req->complete_data; in process_pending_requests()
324 complete = req->complete; in request_complete()
325 complete_data = req->complete_data; in request_complete()
337 struct update_param *par = &req->par.update; in send_frame_handler()
338 int x = par->x; in send_frame_handler()
339 int y = par->y; in send_frame_handler()
340 int w = par->width; in send_frame_handler()
341 int h = par->height; in send_frame_handler()
345 int color_mode = par->color_mode; in send_frame_handler()
346 int flags = par->flags; in send_frame_handler()
347 int scr_width = hwa742.fbdev->panel->x_res; in send_frame_handler()
348 int scr_height = hwa742.fbdev->panel->y_res; in send_frame_handler()
351 dev_dbg(hwa742.fbdev->dev, "x %d y %d w %d h %d scr_width %d " in send_frame_handler()
373 return -EINVAL; in send_frame_handler()
382 flags = req->par.update.flags; in send_frame_handler()
393 hwa742.int_ctrl->setup_plane(OMAPFB_PLANE_GFX, in send_frame_handler()
397 hwa742.extif->set_bits_per_cycle(16); in send_frame_handler()
399 hwa742.int_ctrl->enable_plane(OMAPFB_PLANE_GFX, 1); in send_frame_handler()
400 hwa742.extif->transfer_area(w, h, request_complete, req); in send_frame_handler()
407 hwa742.int_ctrl->enable_plane(OMAPFB_PLANE_GFX, 0); in send_frame_complete()
412 req->handler = send_frame_handler; \
413 req->complete = send_frame_complete; \
414 req->par.update.x = _x; \
415 req->par.update.y = _y; \
416 req->par.update.width = _w; \
417 req->par.update.height = _h; \
418 req->par.update.color_mode = color_mode;\
419 req->par.update.flags = flags; \
420 list_add_tail(&req->entry, req_head); \
428 int x = win->x; in create_req_list()
429 int y = win->y; in create_req_list()
430 int width = win->width; in create_req_list()
431 int height = win->height; in create_req_list()
435 flags = win->format & ~OMAPFB_FORMAT_MASK; in create_req_list()
436 color_mode = win->format & OMAPFB_FORMAT_MASK; in create_req_list()
440 width--; in create_req_list()
453 yspan = height - yspan; in create_req_list()
459 width -= xspan; in create_req_list()
481 last->complete = auto_update_complete; in __hwa742_update_window_auto()
482 last->complete_data = NULL; in __hwa742_update_window_auto()
502 dev_dbg(hwa742.fbdev->dev, "invalid update mode\n"); in hwa742_update_window_async()
503 r = -EINVAL; in hwa742_update_window_async()
506 if (unlikely(win->format & in hwa742_update_window_async()
509 dev_dbg(hwa742.fbdev->dev, "invalid window flag\n"); in hwa742_update_window_async()
510 r = -EINVAL; in hwa742_update_window_async()
517 last->complete = complete_callback; in hwa742_update_window_async()
518 last->complete_data = (void *)complete_callback_data; in hwa742_update_window_async()
533 return -EINVAL; in hwa742_setup_plane()
541 return -EINVAL; in hwa742_enable_plane()
543 hwa742.int_ctrl->enable_plane(plane, enable); in hwa742_enable_plane()
550 complete(req->par.sync); in sync_handler()
562 req->handler = sync_handler; in hwa742_sync()
563 req->complete = NULL; in hwa742_sync()
565 req->par.sync = ∁ in hwa742_sync()
567 list_add(&req->entry, &req_list); in hwa742_sync()
575 dev_dbg(hwa742.fbdev->dev, "update_mode %d\n", hwa742.update_mode); in hwa742_bind_client()
585 return -EINVAL; in hwa742_set_update_mode()
590 dev_info(hwa742.fbdev->dev, "HWA742: setting update mode to %s\n", in hwa742_set_update_mode()
632 return (ps + bus_tick - 1) / bus_tick * bus_tick; in round_to_extif_ticks()
649 dev_dbg(hwa742.fbdev->dev, "HWA742 systim %lu ps extif_clk_period %u ps" in calc_reg_timing()
654 t->clk_div = div; in calc_reg_timing()
655 t->cs_on_time = 0; in calc_reg_timing()
656 t->we_on_time = round_to_extif_ticks(t->cs_on_time + 2000, div); in calc_reg_timing()
657 t->re_on_time = round_to_extif_ticks(t->cs_on_time + 2000, div); in calc_reg_timing()
658 t->access_time = round_to_extif_ticks(t->re_on_time + 12200, div); in calc_reg_timing()
659 t->we_off_time = round_to_extif_ticks(t->we_on_time + 1000, div); in calc_reg_timing()
660 t->re_off_time = round_to_extif_ticks(t->re_on_time + 16000, div); in calc_reg_timing()
661 t->cs_off_time = round_to_extif_ticks(t->re_off_time + 1000, div); in calc_reg_timing()
662 t->we_cycle_time = round_to_extif_ticks(2 * systim + 2000, div); in calc_reg_timing()
663 if (t->we_cycle_time < t->we_off_time) in calc_reg_timing()
664 t->we_cycle_time = t->we_off_time; in calc_reg_timing()
665 t->re_cycle_time = round_to_extif_ticks(2 * systim + 2000, div); in calc_reg_timing()
666 if (t->re_cycle_time < t->re_off_time) in calc_reg_timing()
667 t->re_cycle_time = t->re_off_time; in calc_reg_timing()
668 t->cs_pulse_width = 0; in calc_reg_timing()
670 dev_dbg(hwa742.fbdev->dev, "[reg]cson %d csoff %d reon %d reoff %d\n", in calc_reg_timing()
671 t->cs_on_time, t->cs_off_time, t->re_on_time, t->re_off_time); in calc_reg_timing()
672 dev_dbg(hwa742.fbdev->dev, "[reg]weon %d weoff %d recyc %d wecyc %d\n", in calc_reg_timing()
673 t->we_on_time, t->we_off_time, t->re_cycle_time, in calc_reg_timing()
674 t->we_cycle_time); in calc_reg_timing()
675 dev_dbg(hwa742.fbdev->dev, "[reg]rdaccess %d cspulse %d\n", in calc_reg_timing()
676 t->access_time, t->cs_pulse_width); in calc_reg_timing()
678 return hwa742.extif->convert_timings(t); in calc_reg_timing()
696 dev_dbg(hwa742.fbdev->dev, "HWA742 systim %lu ps extif_clk_period %u ps" in calc_lut_timing()
702 t->clk_div = div; in calc_lut_timing()
704 t->cs_on_time = 0; in calc_lut_timing()
705 t->we_on_time = round_to_extif_ticks(t->cs_on_time + 2000, div); in calc_lut_timing()
706 t->re_on_time = round_to_extif_ticks(t->cs_on_time + 2000, div); in calc_lut_timing()
707 t->access_time = round_to_extif_ticks(t->re_on_time + 4 * systim + in calc_lut_timing()
709 t->we_off_time = round_to_extif_ticks(t->we_on_time + 1000, div); in calc_lut_timing()
710 t->re_off_time = round_to_extif_ticks(t->re_on_time + 4 * systim + in calc_lut_timing()
712 t->cs_off_time = round_to_extif_ticks(t->re_off_time + 1000, div); in calc_lut_timing()
713 t->we_cycle_time = round_to_extif_ticks(2 * systim + 2000, div); in calc_lut_timing()
714 if (t->we_cycle_time < t->we_off_time) in calc_lut_timing()
715 t->we_cycle_time = t->we_off_time; in calc_lut_timing()
716 t->re_cycle_time = round_to_extif_ticks(2000 + 4 * systim + 26000, div); in calc_lut_timing()
717 if (t->re_cycle_time < t->re_off_time) in calc_lut_timing()
718 t->re_cycle_time = t->re_off_time; in calc_lut_timing()
719 t->cs_pulse_width = 0; in calc_lut_timing()
721 dev_dbg(hwa742.fbdev->dev, "[lut]cson %d csoff %d reon %d reoff %d\n", in calc_lut_timing()
722 t->cs_on_time, t->cs_off_time, t->re_on_time, t->re_off_time); in calc_lut_timing()
723 dev_dbg(hwa742.fbdev->dev, "[lut]weon %d weoff %d recyc %d wecyc %d\n", in calc_lut_timing()
724 t->we_on_time, t->we_off_time, t->re_cycle_time, in calc_lut_timing()
725 t->we_cycle_time); in calc_lut_timing()
726 dev_dbg(hwa742.fbdev->dev, "[lut]rdaccess %d cspulse %d\n", in calc_lut_timing()
727 t->access_time, t->cs_pulse_width); in calc_lut_timing()
729 return hwa742.extif->convert_timings(t); in calc_lut_timing()
737 hwa742.extif->get_clk_info(&hwa742.extif_clk_period, &max_clk_div); in calc_extif_timings()
758 dev_err(hwa742.fbdev->dev, "can't setup timings\n"); in calc_extif_timings()
759 return -1; in calc_extif_timings()
780 dev_dbg(hwa742.fbdev->dev, in calc_hwa742_clk_rates()
783 dev_dbg(hwa742.fbdev->dev, "sys_clk %ld pix_clk %ld\n", in calc_hwa742_clk_rates()
814 if (hwa742.extif->get_max_tx_rate != NULL) { in setup_tearsync()
820 unsigned long max_tx_rate = hwa742.extif->get_max_tx_rate(); in setup_tearsync()
822 dev_dbg(hwa742.fbdev->dev, "max_tx_rate %ld HZ\n", in setup_tearsync()
845 * TE signal based on HNDP / VNDP in setup_tearsync()
854 * Use HS or'ed with VS as a TE signal if both are needed in setup_tearsync()
873 return -EDOM; in setup_tearsync()
887 dev_dbg(hwa742.fbdev->dev, in setup_tearsync()
890 dev_dbg(hwa742.fbdev->dev, in setup_tearsync()
894 return hwa742.extif->setup_tearsync(1, hs, vs, in setup_tearsync()
900 hwa742.int_ctrl->get_caps(plane, caps); in hwa742_get_caps()
901 caps->ctrl |= OMAPFB_CAPS_MANUAL_UPDATE | in hwa742_get_caps()
904 caps->ctrl |= OMAPFB_CAPS_TEARSYNC; in hwa742_get_caps()
905 caps->wnd_color |= (1 << OMAPFB_COLOR_RGB565) | in hwa742_get_caps()
944 BUG_ON(!fbdev->ext_if || !fbdev->int_ctrl); in hwa742_init()
947 hwa742.extif = fbdev->ext_if; in hwa742_init()
948 hwa742.int_ctrl = fbdev->int_ctrl; in hwa742_init()
950 omapfb_conf = dev_get_platdata(fbdev->dev); in hwa742_init()
956 if ((r = hwa742.int_ctrl->init(fbdev, 1, req_vram)) < 0) in hwa742_init()
959 if ((r = hwa742.extif->init(fbdev)) < 0) in hwa742_init()
965 hwa742.extif->set_timings(&hwa742.reg_timings); in hwa742_init()
971 hwa742.extif->set_timings(&hwa742.reg_timings); in hwa742_init()
975 dev_err(fbdev->dev, "HWA742: invalid revision %02x\n", rev); in hwa742_init()
976 r = -ENODEV; in hwa742_init()
982 dev_err(fbdev->dev, in hwa742_init()
984 r = -ENODEV; in hwa742_init()
989 dev_err(hwa742.fbdev->dev, in hwa742_init()
995 hwa742.max_transmit_size = hwa742.extif->max_transmit_size; in hwa742_init()
1001 hwa742.auto_update_window.width = fbdev->panel->x_res; in hwa742_init()
1002 hwa742.auto_update_window.height = fbdev->panel->y_res; in hwa742_init()
1007 hwa742.prev_color_mode = -1; in hwa742_init()
1017 sema_init(&hwa742.req_sema, i - IRQ_REQ_POOL_SIZE); in hwa742_init()
1020 dev_info(fbdev->dev, ": Epson HWA742 LCD controller rev %d " in hwa742_init()
1021 "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); in hwa742_init()
1027 hwa742.extif->cleanup(); in hwa742_init()
1029 hwa742.int_ctrl->cleanup(); in hwa742_init()
1037 hwa742.extif->cleanup(); in hwa742_cleanup()
1038 hwa742.int_ctrl->cleanup(); in hwa742_cleanup()