panel-dsi-cm.c 30.2 KB
Newer Older
1 2 3
/*
 * Generic DSI Command Mode panel driver
 *
4
 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5 6 7 8 9 10 11 12 13 14 15
 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 */

/* #define DEBUG */

#include <linux/backlight.h>
#include <linux/delay.h>
16
#include <linux/gpio/consumer.h>
17 18 19 20
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/platform_device.h>
21
#include <linux/sched/signal.h>
22 23
#include <linux/slab.h>
#include <linux/workqueue.h>
24
#include <linux/of_device.h>
25
#include <linux/regulator/consumer.h>
26 27

#include <video/mipi_display.h>
T
Tony Lindgren 已提交
28
#include <video/of_display_timing.h>
29

30 31
#include "../dss/omapdss.h"

32 33 34 35 36 37 38 39 40 41 42 43 44
/* DSI Virtual channel. Hardcoded for now. */
#define TCH 0

#define DCS_READ_NUM_ERRORS	0x05
#define DCS_BRIGHTNESS		0x51
#define DCS_CTRL_DISPLAY	0x53
#define DCS_GET_ID1		0xda
#define DCS_GET_ID2		0xdb
#define DCS_GET_ID3		0xdc

struct panel_drv_data {
	struct omap_dss_device dssdev;

45
	struct videomode vm;
46 47 48 49 50 51

	struct platform_device *pdev;

	struct mutex lock;

	struct backlight_device *bldev;
52
	struct backlight_device *extbldev;
53 54 55 56 57 58 59

	unsigned long	hw_guard_end;	/* next value of jiffies when we can
					 * issue the next sleep in/out command
					 */
	unsigned long	hw_guard_wait;	/* max guard time in jiffies */

	/* panel HW configuration from DT or platform data */
60 61
	struct gpio_desc *reset_gpio;
	struct gpio_desc *ext_te_gpio;
62

63 64 65
	struct regulator *vpnl;
	struct regulator *vddi;

66 67
	bool use_dsi_backlight;

68 69 70
	int width_mm;
	int height_mm;

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
	struct omap_dsi_pin_config pin_config;

	/* runtime variables */
	bool enabled;

	bool te_enabled;

	atomic_t do_update;
	int channel;

	struct delayed_work te_timeout_work;

	bool intro_printed;

	struct workqueue_struct *workqueue;

	bool ulps_enabled;
88
	unsigned int ulps_timeout;
89 90 91 92 93 94 95 96 97 98 99 100 101
	struct delayed_work ulps_work;
};

#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)

static irqreturn_t dsicm_te_isr(int irq, void *data);
static void dsicm_te_timeout_work_callback(struct work_struct *work);
static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable);

static int dsicm_panel_reset(struct panel_drv_data *ddata);

static void dsicm_ulps_work(struct work_struct *work);

102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
static void dsicm_bl_power(struct panel_drv_data *ddata, bool enable)
{
	struct backlight_device *backlight;

	if (ddata->bldev)
		backlight = ddata->bldev;
	else if (ddata->extbldev)
		backlight = ddata->extbldev;
	else
		return;

	if (enable) {
		backlight->props.fb_blank = FB_BLANK_UNBLANK;
		backlight->props.state = ~(BL_CORE_FBBLANK | BL_CORE_SUSPENDED);
		backlight->props.power = FB_BLANK_UNBLANK;
	} else {
		backlight->props.fb_blank = FB_BLANK_NORMAL;
		backlight->props.power = FB_BLANK_POWERDOWN;
		backlight->props.state |= BL_CORE_FBBLANK | BL_CORE_SUSPENDED;
	}

	backlight_update_status(backlight);
}

126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
static void hw_guard_start(struct panel_drv_data *ddata, int guard_msec)
{
	ddata->hw_guard_wait = msecs_to_jiffies(guard_msec);
	ddata->hw_guard_end = jiffies + ddata->hw_guard_wait;
}

static void hw_guard_wait(struct panel_drv_data *ddata)
{
	unsigned long wait = ddata->hw_guard_end - jiffies;

	if ((long)wait > 0 && wait <= ddata->hw_guard_wait) {
		set_current_state(TASK_UNINTERRUPTIBLE);
		schedule_timeout(wait);
	}
}

static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)
{
144
	struct omap_dss_device *src = ddata->dssdev.src;
145 146 147
	int r;
	u8 buf[1];

148
	r = src->ops->dsi.dcs_read(src, ddata->channel, dcs_cmd, buf, 1);
149 150 151 152 153 154 155 156 157 158 159

	if (r < 0)
		return r;

	*data = buf[0];

	return 0;
}

static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd)
{
160 161 162
	struct omap_dss_device *src = ddata->dssdev.src;

	return src->ops->dsi.dcs_write(src, ddata->channel, &dcs_cmd, 1);
163 164 165 166
}

static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param)
{
167
	struct omap_dss_device *src = ddata->dssdev.src;
168 169
	u8 buf[2] = { dcs_cmd, param };

170
	return src->ops->dsi.dcs_write(src, ddata->channel, buf, 2);
171 172 173 174 175
}

static int dsicm_sleep_in(struct panel_drv_data *ddata)

{
176
	struct omap_dss_device *src = ddata->dssdev.src;
177 178 179 180 181 182
	u8 cmd;
	int r;

	hw_guard_wait(ddata);

	cmd = MIPI_DCS_ENTER_SLEEP_MODE;
183
	r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, &cmd, 1);
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
	if (r)
		return r;

	hw_guard_start(ddata, 120);

	usleep_range(5000, 10000);

	return 0;
}

static int dsicm_sleep_out(struct panel_drv_data *ddata)
{
	int r;

	hw_guard_wait(ddata);

	r = dsicm_dcs_write_0(ddata, MIPI_DCS_EXIT_SLEEP_MODE);
	if (r)
		return r;

	hw_guard_start(ddata, 120);

	usleep_range(5000, 10000);

	return 0;
}

static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3)
{
	int r;

	r = dsicm_dcs_read_1(ddata, DCS_GET_ID1, id1);
	if (r)
		return r;
	r = dsicm_dcs_read_1(ddata, DCS_GET_ID2, id2);
	if (r)
		return r;
	r = dsicm_dcs_read_1(ddata, DCS_GET_ID3, id3);
	if (r)
		return r;

	return 0;
}

static int dsicm_set_update_window(struct panel_drv_data *ddata,
		u16 x, u16 y, u16 w, u16 h)
{
231
	struct omap_dss_device *src = ddata->dssdev.src;
232 233 234 235 236 237 238 239 240 241 242 243 244
	int r;
	u16 x1 = x;
	u16 x2 = x + w - 1;
	u16 y1 = y;
	u16 y2 = y + h - 1;

	u8 buf[5];
	buf[0] = MIPI_DCS_SET_COLUMN_ADDRESS;
	buf[1] = (x1 >> 8) & 0xff;
	buf[2] = (x1 >> 0) & 0xff;
	buf[3] = (x2 >> 8) & 0xff;
	buf[4] = (x2 >> 0) & 0xff;

245
	r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, buf, sizeof(buf));
246 247 248 249 250 251 252 253 254
	if (r)
		return r;

	buf[0] = MIPI_DCS_SET_PAGE_ADDRESS;
	buf[1] = (y1 >> 8) & 0xff;
	buf[2] = (y1 >> 0) & 0xff;
	buf[3] = (y2 >> 8) & 0xff;
	buf[4] = (y2 >> 0) & 0xff;

255
	r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, buf, sizeof(buf));
256 257 258
	if (r)
		return r;

259
	src->ops->dsi.bta_sync(src, ddata->channel);
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277

	return r;
}

static void dsicm_queue_ulps_work(struct panel_drv_data *ddata)
{
	if (ddata->ulps_timeout > 0)
		queue_delayed_work(ddata->workqueue, &ddata->ulps_work,
				msecs_to_jiffies(ddata->ulps_timeout));
}

static void dsicm_cancel_ulps_work(struct panel_drv_data *ddata)
{
	cancel_delayed_work(&ddata->ulps_work);
}

static int dsicm_enter_ulps(struct panel_drv_data *ddata)
{
278
	struct omap_dss_device *src = ddata->dssdev.src;
279 280 281 282 283 284 285 286 287 288 289
	int r;

	if (ddata->ulps_enabled)
		return 0;

	dsicm_cancel_ulps_work(ddata);

	r = _dsicm_enable_te(ddata, false);
	if (r)
		goto err;

290 291
	if (ddata->ext_te_gpio)
		disable_irq(gpiod_to_irq(ddata->ext_te_gpio));
292

293
	src->ops->dsi.disable(src, false, true);
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311

	ddata->ulps_enabled = true;

	return 0;

err:
	dev_err(&ddata->pdev->dev, "enter ULPS failed");
	dsicm_panel_reset(ddata);

	ddata->ulps_enabled = false;

	dsicm_queue_ulps_work(ddata);

	return r;
}

static int dsicm_exit_ulps(struct panel_drv_data *ddata)
{
312
	struct omap_dss_device *src = ddata->dssdev.src;
313 314 315 316 317
	int r;

	if (!ddata->ulps_enabled)
		return 0;

318
	r = src->ops->enable(src);
319 320 321 322 323
	if (r) {
		dev_err(&ddata->pdev->dev, "failed to enable DSI\n");
		goto err1;
	}

324
	src->ops->dsi.enable_hs(src, ddata->channel, true);
325 326 327 328 329 330 331

	r = _dsicm_enable_te(ddata, true);
	if (r) {
		dev_err(&ddata->pdev->dev, "failed to re-enable TE");
		goto err2;
	}

332 333
	if (ddata->ext_te_gpio)
		enable_irq(gpiod_to_irq(ddata->ext_te_gpio));
334 335 336 337 338 339 340 341 342 343 344 345

	dsicm_queue_ulps_work(ddata);

	ddata->ulps_enabled = false;

	return 0;

err2:
	dev_err(&ddata->pdev->dev, "failed to exit ULPS");

	r = dsicm_panel_reset(ddata);
	if (!r) {
346 347
		if (ddata->ext_te_gpio)
			enable_irq(gpiod_to_irq(ddata->ext_te_gpio));
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
		ddata->ulps_enabled = false;
	}
err1:
	dsicm_queue_ulps_work(ddata);

	return r;
}

static int dsicm_wake_up(struct panel_drv_data *ddata)
{
	if (ddata->ulps_enabled)
		return dsicm_exit_ulps(ddata);

	dsicm_cancel_ulps_work(ddata);
	dsicm_queue_ulps_work(ddata);
	return 0;
}

static int dsicm_bl_update_status(struct backlight_device *dev)
{
	struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
369
	struct omap_dss_device *src = ddata->dssdev.src;
370
	int r = 0;
371 372 373 374 375 376 377 378 379 380 381 382 383
	int level;

	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
			dev->props.power == FB_BLANK_UNBLANK)
		level = dev->props.brightness;
	else
		level = 0;

	dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level);

	mutex_lock(&ddata->lock);

	if (ddata->enabled) {
384
		src->ops->dsi.bus_lock(src);
385 386 387 388 389

		r = dsicm_wake_up(ddata);
		if (!r)
			r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level);

390
		src->ops->dsi.bus_unlock(src);
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
	}

	mutex_unlock(&ddata->lock);

	return r;
}

static int dsicm_bl_get_intensity(struct backlight_device *dev)
{
	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
			dev->props.power == FB_BLANK_UNBLANK)
		return dev->props.brightness;

	return 0;
}

static const struct backlight_ops dsicm_bl_ops = {
	.get_brightness = dsicm_bl_get_intensity,
	.update_status  = dsicm_bl_update_status,
};

static ssize_t dsicm_num_errors_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
417
	struct omap_dss_device *src = ddata->dssdev.src;
418 419 420 421 422 423
	u8 errors = 0;
	int r;

	mutex_lock(&ddata->lock);

	if (ddata->enabled) {
424
		src->ops->dsi.bus_lock(src);
425 426 427 428 429 430

		r = dsicm_wake_up(ddata);
		if (!r)
			r = dsicm_dcs_read_1(ddata, DCS_READ_NUM_ERRORS,
					&errors);

431
		src->ops->dsi.bus_unlock(src);
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
	} else {
		r = -ENODEV;
	}

	mutex_unlock(&ddata->lock);

	if (r)
		return r;

	return snprintf(buf, PAGE_SIZE, "%d\n", errors);
}

static ssize_t dsicm_hw_revision_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
449
	struct omap_dss_device *src = ddata->dssdev.src;
450 451 452 453 454 455
	u8 id1, id2, id3;
	int r;

	mutex_lock(&ddata->lock);

	if (ddata->enabled) {
456
		src->ops->dsi.bus_lock(src);
457 458 459 460 461

		r = dsicm_wake_up(ddata);
		if (!r)
			r = dsicm_get_id(ddata, &id1, &id2, &id3);

462
		src->ops->dsi.bus_unlock(src);
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
	} else {
		r = -ENODEV;
	}

	mutex_unlock(&ddata->lock);

	if (r)
		return r;

	return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3);
}

static ssize_t dsicm_store_ulps(struct device *dev,
		struct device_attribute *attr,
		const char *buf, size_t count)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
481
	struct omap_dss_device *src = ddata->dssdev.src;
482 483 484 485 486 487 488 489 490 491
	unsigned long t;
	int r;

	r = kstrtoul(buf, 0, &t);
	if (r)
		return r;

	mutex_lock(&ddata->lock);

	if (ddata->enabled) {
492
		src->ops->dsi.bus_lock(src);
493 494 495 496 497 498

		if (t)
			r = dsicm_enter_ulps(ddata);
		else
			r = dsicm_wake_up(ddata);

499
		src->ops->dsi.bus_unlock(src);
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515
	}

	mutex_unlock(&ddata->lock);

	if (r)
		return r;

	return count;
}

static ssize_t dsicm_show_ulps(struct device *dev,
		struct device_attribute *attr,
		char *buf)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
516
	unsigned int t;
517 518 519 520 521 522 523 524 525 526 527 528 529 530

	mutex_lock(&ddata->lock);
	t = ddata->ulps_enabled;
	mutex_unlock(&ddata->lock);

	return snprintf(buf, PAGE_SIZE, "%u\n", t);
}

static ssize_t dsicm_store_ulps_timeout(struct device *dev,
		struct device_attribute *attr,
		const char *buf, size_t count)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
531
	struct omap_dss_device *src = ddata->dssdev.src;
532 533 534 535 536 537 538 539 540 541 542 543
	unsigned long t;
	int r;

	r = kstrtoul(buf, 0, &t);
	if (r)
		return r;

	mutex_lock(&ddata->lock);
	ddata->ulps_timeout = t;

	if (ddata->enabled) {
		/* dsicm_wake_up will restart the timer */
544
		src->ops->dsi.bus_lock(src);
545
		r = dsicm_wake_up(ddata);
546
		src->ops->dsi.bus_unlock(src);
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562
	}

	mutex_unlock(&ddata->lock);

	if (r)
		return r;

	return count;
}

static ssize_t dsicm_show_ulps_timeout(struct device *dev,
		struct device_attribute *attr,
		char *buf)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
563
	unsigned int t;
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586

	mutex_lock(&ddata->lock);
	t = ddata->ulps_timeout;
	mutex_unlock(&ddata->lock);

	return snprintf(buf, PAGE_SIZE, "%u\n", t);
}

static DEVICE_ATTR(num_dsi_errors, S_IRUGO, dsicm_num_errors_show, NULL);
static DEVICE_ATTR(hw_revision, S_IRUGO, dsicm_hw_revision_show, NULL);
static DEVICE_ATTR(ulps, S_IRUGO | S_IWUSR,
		dsicm_show_ulps, dsicm_store_ulps);
static DEVICE_ATTR(ulps_timeout, S_IRUGO | S_IWUSR,
		dsicm_show_ulps_timeout, dsicm_store_ulps_timeout);

static struct attribute *dsicm_attrs[] = {
	&dev_attr_num_dsi_errors.attr,
	&dev_attr_hw_revision.attr,
	&dev_attr_ulps.attr,
	&dev_attr_ulps_timeout.attr,
	NULL,
};

587
static const struct attribute_group dsicm_attr_group = {
588 589 590 591 592
	.attrs = dsicm_attrs,
};

static void dsicm_hw_reset(struct panel_drv_data *ddata)
{
593
	gpiod_set_value(ddata->reset_gpio, 1);
594 595
	udelay(10);
	/* reset the panel */
596
	gpiod_set_value(ddata->reset_gpio, 0);
597 598
	/* assert reset */
	udelay(10);
599
	gpiod_set_value(ddata->reset_gpio, 1);
600 601 602 603 604 605
	/* wait after releasing reset */
	usleep_range(5000, 10000);
}

static int dsicm_power_on(struct panel_drv_data *ddata)
{
606
	struct omap_dss_device *src = ddata->dssdev.src;
607 608 609 610 611
	u8 id1, id2, id3;
	int r;
	struct omap_dss_dsi_config dsi_config = {
		.mode = OMAP_DSS_DSI_CMD_MODE,
		.pixel_format = OMAP_DSS_DSI_FMT_RGB888,
612
		.vm = &ddata->vm,
613 614 615 616 617 618
		.hs_clk_min = 150000000,
		.hs_clk_max = 300000000,
		.lp_clk_min = 7000000,
		.lp_clk_max = 10000000,
	};

619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
	if (ddata->vpnl) {
		r = regulator_enable(ddata->vpnl);
		if (r) {
			dev_err(&ddata->pdev->dev,
				"failed to enable VPNL: %d\n", r);
			return r;
		}
	}

	if (ddata->vddi) {
		r = regulator_enable(ddata->vddi);
		if (r) {
			dev_err(&ddata->pdev->dev,
				"failed to enable VDDI: %d\n", r);
			goto err_vpnl;
		}
	}

637
	if (ddata->pin_config.num_pins > 0) {
638
		r = src->ops->dsi.configure_pins(src, &ddata->pin_config);
639 640 641
		if (r) {
			dev_err(&ddata->pdev->dev,
				"failed to configure DSI pins\n");
642
			goto err_vddi;
643
		}
J
Joe Perches 已提交
644
	}
645

646
	r = src->ops->dsi.set_config(src, &dsi_config);
647 648
	if (r) {
		dev_err(&ddata->pdev->dev, "failed to configure DSI\n");
649
		goto err_vddi;
650 651
	}

652
	r = src->ops->enable(src);
653 654
	if (r) {
		dev_err(&ddata->pdev->dev, "failed to enable DSI\n");
655
		goto err_vddi;
656 657 658 659
	}

	dsicm_hw_reset(ddata);

660
	src->ops->dsi.enable_hs(src, ddata->channel, false);
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691

	r = dsicm_sleep_out(ddata);
	if (r)
		goto err;

	r = dsicm_get_id(ddata, &id1, &id2, &id3);
	if (r)
		goto err;

	r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, 0xff);
	if (r)
		goto err;

	r = dsicm_dcs_write_1(ddata, DCS_CTRL_DISPLAY,
			(1<<2) | (1<<5));	/* BL | BCTRL */
	if (r)
		goto err;

	r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_PIXEL_FORMAT,
		MIPI_DCS_PIXEL_FMT_24BIT);
	if (r)
		goto err;

	r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_DISPLAY_ON);
	if (r)
		goto err;

	r = _dsicm_enable_te(ddata, ddata->te_enabled);
	if (r)
		goto err;

692
	r = src->ops->dsi.enable_video_output(src, ddata->channel);
693 694 695 696 697 698 699 700 701 702 703
	if (r)
		goto err;

	ddata->enabled = 1;

	if (!ddata->intro_printed) {
		dev_info(&ddata->pdev->dev, "panel revision %02x.%02x.%02x\n",
			id1, id2, id3);
		ddata->intro_printed = true;
	}

704
	src->ops->dsi.enable_hs(src, ddata->channel, true);
705 706 707 708 709 710 711

	return 0;
err:
	dev_err(&ddata->pdev->dev, "error while enabling panel, issuing HW reset\n");

	dsicm_hw_reset(ddata);

712
	src->ops->dsi.disable(src, true, false);
713 714 715 716 717 718 719
err_vddi:
	if (ddata->vddi)
		regulator_disable(ddata->vddi);
err_vpnl:
	if (ddata->vpnl)
		regulator_disable(ddata->vpnl);

720 721 722 723 724
	return r;
}

static void dsicm_power_off(struct panel_drv_data *ddata)
{
725
	struct omap_dss_device *src = ddata->dssdev.src;
726 727
	int r;

728
	src->ops->dsi.disable_video_output(src, ddata->channel);
729 730 731 732 733 734 735 736 737 738 739

	r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_DISPLAY_OFF);
	if (!r)
		r = dsicm_sleep_in(ddata);

	if (r) {
		dev_err(&ddata->pdev->dev,
				"error disabling panel, issuing HW reset\n");
		dsicm_hw_reset(ddata);
	}

740
	src->ops->dsi.disable(src, true, false);
741

742 743 744 745 746
	if (ddata->vddi)
		regulator_disable(ddata->vddi);
	if (ddata->vpnl)
		regulator_disable(ddata->vpnl);

747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762
	ddata->enabled = 0;
}

static int dsicm_panel_reset(struct panel_drv_data *ddata)
{
	dev_err(&ddata->pdev->dev, "performing LCD reset\n");

	dsicm_power_off(ddata);
	dsicm_hw_reset(ddata);
	return dsicm_power_on(ddata);
}

static int dsicm_connect(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct device *dev = &ddata->pdev->dev;
763
	struct omap_dss_device *src;
764 765
	int r;

766 767
	src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
	if (IS_ERR_OR_NULL(src)) {
768
		dev_err(dssdev->dev, "failed to find video source\n");
769
		return src ? PTR_ERR(src) : -EINVAL;
770 771
	}

772
	r = omapdss_device_connect(dssdev->dss, src, dssdev);
773 774
	if (r) {
		dev_err(dev, "Failed to connect to video source\n");
775
		goto err_connect;
776 777
	}

778
	r = src->ops->dsi.request_vc(src, &ddata->channel);
779 780 781 782 783
	if (r) {
		dev_err(dev, "failed to get virtual channel\n");
		goto err_req_vc;
	}

784
	r = src->ops->dsi.set_vc_id(src, ddata->channel, TCH);
785 786 787 788 789 790 791 792
	if (r) {
		dev_err(dev, "failed to set VC_ID\n");
		goto err_vc_id;
	}

	return 0;

err_vc_id:
793
	src->ops->dsi.release_vc(src, ddata->channel);
794
err_req_vc:
795
	omapdss_device_disconnect(src, dssdev);
796
err_connect:
797
	omapdss_device_put(src);
798 799 800 801 802 803
	return r;
}

static void dsicm_disconnect(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
804
	struct omap_dss_device *src = dssdev->src;
805

806 807
	src->ops->dsi.release_vc(src, ddata->channel);
	omapdss_device_disconnect(src, dssdev);
808

809
	omapdss_device_put(src);
810 811 812 813 814
}

static int dsicm_enable(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
815
	struct omap_dss_device *src = dssdev->src;
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831
	int r;

	dev_dbg(&ddata->pdev->dev, "enable\n");

	mutex_lock(&ddata->lock);

	if (!omapdss_device_is_connected(dssdev)) {
		r = -ENODEV;
		goto err;
	}

	if (omapdss_device_is_enabled(dssdev)) {
		r = 0;
		goto err;
	}

832
	src->ops->dsi.bus_lock(src);
833 834 835

	r = dsicm_power_on(ddata);

836
	src->ops->dsi.bus_unlock(src);
837 838 839 840 841 842 843 844

	if (r)
		goto err;

	dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;

	mutex_unlock(&ddata->lock);

845 846
	dsicm_bl_power(ddata, true);

847 848 849 850 851 852 853 854 855 856
	return 0;
err:
	dev_dbg(&ddata->pdev->dev, "enable failed\n");
	mutex_unlock(&ddata->lock);
	return r;
}

static void dsicm_disable(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
857
	struct omap_dss_device *src = dssdev->src;
858 859 860 861
	int r;

	dev_dbg(&ddata->pdev->dev, "disable\n");

862 863
	dsicm_bl_power(ddata, false);

864 865 866 867
	mutex_lock(&ddata->lock);

	dsicm_cancel_ulps_work(ddata);

868
	src->ops->dsi.bus_lock(src);
869 870 871 872 873 874 875

	if (omapdss_device_is_enabled(dssdev)) {
		r = dsicm_wake_up(ddata);
		if (!r)
			dsicm_power_off(ddata);
	}

876
	src->ops->dsi.bus_unlock(src);
877 878 879 880 881 882 883 884 885

	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;

	mutex_unlock(&ddata->lock);
}

static void dsicm_framedone_cb(int err, void *data)
{
	struct panel_drv_data *ddata = data;
886
	struct omap_dss_device *src = ddata->dssdev.src;
887 888

	dev_dbg(&ddata->pdev->dev, "framedone, err %d\n", err);
889
	src->ops->dsi.bus_unlock(src);
890 891 892 893 894
}

static irqreturn_t dsicm_te_isr(int irq, void *data)
{
	struct panel_drv_data *ddata = data;
895
	struct omap_dss_device *src = ddata->dssdev.src;
896 897 898 899 900 901 902 903
	int old;
	int r;

	old = atomic_cmpxchg(&ddata->do_update, 1, 0);

	if (old) {
		cancel_delayed_work(&ddata->te_timeout_work);

904
		r = src->ops->dsi.update(src, ddata->channel, dsicm_framedone_cb,
905 906 907 908 909 910 911 912
				ddata);
		if (r)
			goto err;
	}

	return IRQ_HANDLED;
err:
	dev_err(&ddata->pdev->dev, "start update failed\n");
913
	src->ops->dsi.bus_unlock(src);
914 915 916 917 918 919 920
	return IRQ_HANDLED;
}

static void dsicm_te_timeout_work_callback(struct work_struct *work)
{
	struct panel_drv_data *ddata = container_of(work, struct panel_drv_data,
					te_timeout_work.work);
921
	struct omap_dss_device *src = ddata->dssdev.src;
922 923 924 925

	dev_err(&ddata->pdev->dev, "TE not received for 250ms!\n");

	atomic_set(&ddata->do_update, 0);
926
	src->ops->dsi.bus_unlock(src);
927 928 929 930 931 932
}

static int dsicm_update(struct omap_dss_device *dssdev,
				    u16 x, u16 y, u16 w, u16 h)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
933
	struct omap_dss_device *src = dssdev->src;
934 935 936 937 938
	int r;

	dev_dbg(&ddata->pdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);

	mutex_lock(&ddata->lock);
939
	src->ops->dsi.bus_lock(src);
940 941 942 943 944 945 946 947 948 949 950

	r = dsicm_wake_up(ddata);
	if (r)
		goto err;

	if (!ddata->enabled) {
		r = 0;
		goto err;
	}

	/* XXX no need to send this every frame, but dsi break if not done */
951 952
	r = dsicm_set_update_window(ddata, 0, 0, ddata->vm.hactive,
				    ddata->vm.vactive);
953 954 955
	if (r)
		goto err;

956
	if (ddata->te_enabled && ddata->ext_te_gpio) {
957 958 959 960
		schedule_delayed_work(&ddata->te_timeout_work,
				msecs_to_jiffies(250));
		atomic_set(&ddata->do_update, 1);
	} else {
961
		r = src->ops->dsi.update(src, ddata->channel, dsicm_framedone_cb,
962 963 964 965 966
				ddata);
		if (r)
			goto err;
	}

967
	/* note: no bus_unlock here. unlock is src framedone_cb */
968 969 970
	mutex_unlock(&ddata->lock);
	return 0;
err:
971
	src->ops->dsi.bus_unlock(src);
972 973 974 975 976 977 978
	mutex_unlock(&ddata->lock);
	return r;
}

static int dsicm_sync(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
979
	struct omap_dss_device *src = dssdev->src;
980 981 982 983

	dev_dbg(&ddata->pdev->dev, "sync\n");

	mutex_lock(&ddata->lock);
984 985
	src->ops->dsi.bus_lock(src);
	src->ops->dsi.bus_unlock(src);
986 987 988 989 990 991 992 993 994
	mutex_unlock(&ddata->lock);

	dev_dbg(&ddata->pdev->dev, "sync done\n");

	return 0;
}

static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable)
{
995
	struct omap_dss_device *src = ddata->dssdev.src;
996 997 998 999 1000 1001 1002
	int r;

	if (enable)
		r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_TEAR_ON, 0);
	else
		r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_TEAR_OFF);

1003
	if (!ddata->ext_te_gpio)
1004
		src->ops->dsi.enable_te(src, enable);
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014

	/* possible panel bug */
	msleep(100);

	return r;
}

static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
1015
	struct omap_dss_device *src = dssdev->src;
1016 1017 1018 1019 1020 1021 1022
	int r;

	mutex_lock(&ddata->lock);

	if (ddata->te_enabled == enable)
		goto end;

1023
	src->ops->dsi.bus_lock(src);
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036

	if (ddata->enabled) {
		r = dsicm_wake_up(ddata);
		if (r)
			goto err;

		r = _dsicm_enable_te(ddata, enable);
		if (r)
			goto err;
	}

	ddata->te_enabled = enable;

1037
	src->ops->dsi.bus_unlock(src);
1038 1039 1040 1041 1042
end:
	mutex_unlock(&ddata->lock);

	return 0;
err:
1043
	src->ops->dsi.bus_unlock(src);
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065
	mutex_unlock(&ddata->lock);

	return r;
}

static int dsicm_get_te(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	int r;

	mutex_lock(&ddata->lock);
	r = ddata->te_enabled;
	mutex_unlock(&ddata->lock);

	return r;
}

static int dsicm_memory_read(struct omap_dss_device *dssdev,
		void *buf, size_t size,
		u16 x, u16 y, u16 w, u16 h)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
1066
	struct omap_dss_device *src = dssdev->src;
1067 1068 1069
	int r;
	int first = 1;
	int plen;
1070
	unsigned int buf_used = 0;
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081

	if (size < w * h * 3)
		return -ENOMEM;

	mutex_lock(&ddata->lock);

	if (!ddata->enabled) {
		r = -ENODEV;
		goto err1;
	}

1082
	size = min((u32)w * h * 3,
1083
		   ddata->vm.hactive * ddata->vm.vactive * 3);
1084

1085
	src->ops->dsi.bus_lock(src);
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100

	r = dsicm_wake_up(ddata);
	if (r)
		goto err2;

	/* plen 1 or 2 goes into short packet. until checksum error is fixed,
	 * use short packets. plen 32 works, but bigger packets seem to cause
	 * an error. */
	if (size % 2)
		plen = 1;
	else
		plen = 2;

	dsicm_set_update_window(ddata, x, y, w, h);

1101
	r = src->ops->dsi.set_max_rx_packet_size(src, ddata->channel, plen);
1102 1103 1104 1105 1106 1107 1108
	if (r)
		goto err2;

	while (buf_used < size) {
		u8 dcs_cmd = first ? 0x2e : 0x3e;
		first = 0;

1109
		r = src->ops->dsi.dcs_read(src, ddata->channel, dcs_cmd,
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134
				buf + buf_used, size - buf_used);

		if (r < 0) {
			dev_err(dssdev->dev, "read error\n");
			goto err3;
		}

		buf_used += r;

		if (r < plen) {
			dev_err(&ddata->pdev->dev, "short read\n");
			break;
		}

		if (signal_pending(current)) {
			dev_err(&ddata->pdev->dev, "signal pending, "
					"aborting memory read\n");
			r = -ERESTARTSYS;
			goto err3;
		}
	}

	r = buf_used;

err3:
1135
	src->ops->dsi.set_max_rx_packet_size(src, ddata->channel, 1);
1136
err2:
1137
	src->ops->dsi.bus_unlock(src);
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147
err1:
	mutex_unlock(&ddata->lock);
	return r;
}

static void dsicm_ulps_work(struct work_struct *work)
{
	struct panel_drv_data *ddata = container_of(work, struct panel_drv_data,
			ulps_work.work);
	struct omap_dss_device *dssdev = &ddata->dssdev;
1148
	struct omap_dss_device *src = dssdev->src;
1149 1150 1151 1152 1153 1154 1155 1156

	mutex_lock(&ddata->lock);

	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE || !ddata->enabled) {
		mutex_unlock(&ddata->lock);
		return;
	}

1157
	src->ops->dsi.bus_lock(src);
1158 1159 1160

	dsicm_enter_ulps(ddata);

1161
	src->ops->dsi.bus_unlock(src);
1162 1163 1164
	mutex_unlock(&ddata->lock);
}

T
Tony Lindgren 已提交
1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194
static void dsicm_get_timings(struct omap_dss_device *dssdev,
			      struct videomode *vm)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);

	*vm = ddata->vm;
}

static int dsicm_check_timings(struct omap_dss_device *dssdev,
			       struct videomode *vm)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	int ret = 0;

	if (vm->hactive != ddata->vm.hactive)
		ret = -EINVAL;

	if (vm->vactive != ddata->vm.vactive)
		ret = -EINVAL;

	if (ret) {
		dev_warn(dssdev->dev, "wrong resolution: %d x %d",
			 vm->hactive, vm->vactive);
		dev_warn(dssdev->dev, "panel resolution: %d x %d",
			 ddata->vm.hactive, ddata->vm.vactive);
	}

	return ret;
}

1195 1196 1197 1198 1199 1200 1201 1202 1203
static void dsicm_get_size(struct omap_dss_device *dssdev,
			  unsigned int *width, unsigned int *height)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);

	*width = ddata->width_mm;
	*height = ddata->height_mm;
}

1204
static const struct omap_dss_driver dsicm_ops = {
1205 1206 1207 1208 1209 1210 1211 1212 1213
	.connect	= dsicm_connect,
	.disconnect	= dsicm_disconnect,

	.enable		= dsicm_enable,
	.disable	= dsicm_disable,

	.update		= dsicm_update,
	.sync		= dsicm_sync,

T
Tony Lindgren 已提交
1214 1215
	.get_timings	= dsicm_get_timings,
	.check_timings	= dsicm_check_timings,
1216
	.get_size	= dsicm_get_size,
T
Tony Lindgren 已提交
1217

1218 1219 1220 1221 1222 1223
	.enable_te	= dsicm_enable_te,
	.get_te		= dsicm_get_te,

	.memory_read	= dsicm_memory_read,
};

1224 1225 1226
static int dsicm_probe_of(struct platform_device *pdev)
{
	struct device_node *node = pdev->dev.of_node;
1227
	struct device_node *backlight;
1228
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
T
Tony Lindgren 已提交
1229
	struct display_timing timing;
1230
	int err;
1231

1232 1233 1234 1235 1236
	ddata->reset_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);
	if (IS_ERR(ddata->reset_gpio)) {
		err = PTR_ERR(ddata->reset_gpio);
		dev_err(&pdev->dev, "reset gpio request failed: %d", err);
		return err;
1237 1238
	}

1239 1240 1241 1242 1243 1244
	ddata->ext_te_gpio = devm_gpiod_get_optional(&pdev->dev, "te",
						     GPIOD_IN);
	if (IS_ERR(ddata->ext_te_gpio)) {
		err = PTR_ERR(ddata->ext_te_gpio);
		dev_err(&pdev->dev, "TE gpio request failed: %d", err);
		return err;
1245 1246
	}

T
Tony Lindgren 已提交
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257
	err = of_get_display_timing(node, "panel-timing", &timing);
	if (!err) {
		videomode_from_timing(&timing, &ddata->vm);
		if (!ddata->vm.pixelclock)
			ddata->vm.pixelclock =
				ddata->vm.hactive * ddata->vm.vactive * 60;
	} else {
		dev_warn(&pdev->dev,
			 "failed to get video timing, using defaults\n");
	}

1258 1259 1260 1261 1262 1263
	ddata->width_mm = 0;
	of_property_read_u32(node, "width-mm", &ddata->width_mm);

	ddata->height_mm = 0;
	of_property_read_u32(node, "height-mm", &ddata->height_mm);

1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279
	ddata->vpnl = devm_regulator_get_optional(&pdev->dev, "vpnl");
	if (IS_ERR(ddata->vpnl)) {
		err = PTR_ERR(ddata->vpnl);
		if (err == -EPROBE_DEFER)
			return err;
		ddata->vpnl = NULL;
	}

	ddata->vddi = devm_regulator_get_optional(&pdev->dev, "vddi");
	if (IS_ERR(ddata->vddi)) {
		err = PTR_ERR(ddata->vddi);
		if (err == -EPROBE_DEFER)
			return err;
		ddata->vddi = NULL;
	}

1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292
	backlight = of_parse_phandle(node, "backlight", 0);
	if (backlight) {
		ddata->extbldev = of_find_backlight_by_node(backlight);
		of_node_put(backlight);

		if (!ddata->extbldev)
			return -EPROBE_DEFER;
	} else {
		/* assume native backlight support */
		ddata->use_dsi_backlight = true;
	}

	/* TODO: ulps */
1293 1294 1295 1296

	return 0;
}

1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313
static int dsicm_probe(struct platform_device *pdev)
{
	struct panel_drv_data *ddata;
	struct backlight_device *bldev = NULL;
	struct device *dev = &pdev->dev;
	struct omap_dss_device *dssdev;
	int r;

	dev_dbg(dev, "probe\n");

	ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
	if (!ddata)
		return -ENOMEM;

	platform_set_drvdata(pdev, ddata);
	ddata->pdev = pdev;

1314 1315 1316
	ddata->vm.hactive = 864;
	ddata->vm.vactive = 480;
	ddata->vm.pixelclock = 864 * 480 * 60;
1317

T
Tony Lindgren 已提交
1318 1319 1320 1321
	r = dsicm_probe_of(pdev);
	if (r)
		return r;

1322 1323 1324 1325 1326
	dssdev = &ddata->dssdev;
	dssdev->dev = dev;
	dssdev->driver = &dsicm_ops;
	dssdev->type = OMAP_DISPLAY_TYPE_DSI;
	dssdev->owner = THIS_MODULE;
1327
	dssdev->of_ports = BIT(0);
1328 1329 1330 1331

	dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
		OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;

1332
	omapdss_display_init(dssdev);
1333
	omapdss_device_register(dssdev);
1334 1335 1336 1337 1338

	mutex_init(&ddata->lock);

	atomic_set(&ddata->do_update, 0);

1339 1340
	if (ddata->ext_te_gpio) {
		r = devm_request_irq(dev, gpiod_to_irq(ddata->ext_te_gpio),
1341 1342 1343 1344 1345 1346
				dsicm_te_isr,
				IRQF_TRIGGER_RISING,
				"taal vsync", ddata);

		if (r) {
			dev_err(dev, "IRQ request failed\n");
1347
			goto err_reg;
1348 1349 1350 1351 1352 1353 1354 1355 1356
		}

		INIT_DEFERRABLE_WORK(&ddata->te_timeout_work,
					dsicm_te_timeout_work_callback);

		dev_dbg(dev, "Using GPIO TE\n");
	}

	ddata->workqueue = create_singlethread_workqueue("dsicm_wq");
1357 1358 1359
	if (!ddata->workqueue) {
		r = -ENOMEM;
		goto err_reg;
1360 1361 1362 1363 1364 1365
	}
	INIT_DELAYED_WORK(&ddata->ulps_work, dsicm_ulps_work);

	dsicm_hw_reset(ddata);

	if (ddata->use_dsi_backlight) {
1366
		struct backlight_properties props = { 0 };
1367 1368
		props.max_brightness = 255;
		props.type = BACKLIGHT_RAW;
1369 1370 1371

		bldev = devm_backlight_device_register(dev, dev_name(dev),
			dev, ddata, &dsicm_bl_ops, &props);
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382
		if (IS_ERR(bldev)) {
			r = PTR_ERR(bldev);
			goto err_bl;
		}

		ddata->bldev = bldev;
	}

	r = sysfs_create_group(&dev->kobj, &dsicm_attr_group);
	if (r) {
		dev_err(dev, "failed to create sysfs files\n");
1383
		goto err_bl;
1384 1385 1386 1387 1388 1389 1390
	}

	return 0;

err_bl:
	destroy_workqueue(ddata->workqueue);
err_reg:
1391 1392 1393
	if (ddata->extbldev)
		put_device(&ddata->extbldev->dev);

1394 1395 1396 1397 1398 1399 1400 1401 1402 1403
	return r;
}

static int __exit dsicm_remove(struct platform_device *pdev)
{
	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
	struct omap_dss_device *dssdev = &ddata->dssdev;

	dev_dbg(&pdev->dev, "remove\n");

1404
	omapdss_device_unregister(dssdev);
1405 1406

	dsicm_disable(dssdev);
1407
	omapdss_device_disconnect(dssdev, NULL);
1408 1409 1410

	sysfs_remove_group(&pdev->dev.kobj, &dsicm_attr_group);

1411 1412
	if (ddata->extbldev)
		put_device(&ddata->extbldev->dev);
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422

	dsicm_cancel_ulps_work(ddata);
	destroy_workqueue(ddata->workqueue);

	/* reset, to be sure that the panel is in a valid state */
	dsicm_hw_reset(ddata);

	return 0;
}

1423 1424 1425 1426 1427 1428 1429
static const struct of_device_id dsicm_of_match[] = {
	{ .compatible = "omapdss,panel-dsi-cm", },
	{},
};

MODULE_DEVICE_TABLE(of, dsicm_of_match);

1430 1431 1432 1433 1434
static struct platform_driver dsicm_driver = {
	.probe = dsicm_probe,
	.remove = __exit_p(dsicm_remove),
	.driver = {
		.name = "panel-dsi-cm",
1435
		.of_match_table = dsicm_of_match,
T
Tomi Valkeinen 已提交
1436
		.suppress_bind_attrs = true,
1437 1438 1439 1440 1441 1442 1443 1444
	},
};

module_platform_driver(dsicm_driver);

MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
MODULE_DESCRIPTION("Generic DSI Command Mode Panel Driver");
MODULE_LICENSE("GPL");