Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'drm/panel/for-next' into drm/tegra/for-next

+383 -65
+7
Documentation/devicetree/bindings/panel/auo,b116xw03.txt
··· 1 + AU Optronics Corporation 11.6" HD (1366x768) color TFT-LCD panel 2 + 3 + Required properties: 4 + - compatible: should be "auo,b116xw03" 5 + 6 + This binding is compatible with the simple-panel binding, which is specified 7 + in simple-panel.txt in this directory.
+7
Documentation/devicetree/bindings/panel/hannstar,hsd070pww1.txt
··· 1 + HannStar Display Corp. HSD070PWW1 7.0" WXGA TFT LCD panel 2 + 3 + Required properties: 4 + - compatible: should be "hannstar,hsd070pww1" 5 + 6 + This binding is compatible with the simple-panel binding, which is specified 7 + in simple-panel.txt in this directory.
+7
Documentation/devicetree/bindings/panel/hit,tx23d38vm0caa.txt
··· 1 + Hitachi Ltd. Corporation 9" WVGA (800x480) TFT LCD panel 2 + 3 + Required properties: 4 + - compatible: should be "hit,tx23d38vm0caa" 5 + 6 + This binding is compatible with the simple-panel binding, which is specified 7 + in simple-panel.txt in this directory.
+7
Documentation/devicetree/bindings/panel/innolux,g121i1-l01.txt
··· 1 + Innolux Corporation 12.1" WXGA (1280x800) TFT LCD panel 2 + 3 + Required properties: 4 + - compatible: should be "innolux,g121i1-l01" 5 + 6 + This binding is compatible with the simple-panel binding, which is specified 7 + in simple-panel.txt in this directory.
+2
Documentation/devicetree/bindings/vendor-prefixes.txt
··· 64 64 google Google, Inc. 65 65 gumstix Gumstix, Inc. 66 66 gw Gateworks Corporation 67 + hannstar HannStar Display Corporation 67 68 haoyu Haoyu Microelectronic Co. Ltd. 68 69 hisilicon Hisilicon Limited. 70 + hit Hitachi Ltd. 69 71 honeywell Honeywell 70 72 hp Hewlett Packard 71 73 i2se I2SE GmbH
+201 -28
drivers/gpu/drm/drm_mipi_dsi.c
··· 198 198 } 199 199 EXPORT_SYMBOL(mipi_dsi_detach); 200 200 201 - /** 202 - * mipi_dsi_dcs_write - send DCS write command 203 - * @dsi: DSI device 204 - * @data: pointer to the command followed by parameters 205 - * @len: length of @data 206 - */ 207 - ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, const void *data, 208 - size_t len) 201 + static ssize_t mipi_dsi_device_transfer(struct mipi_dsi_device *dsi, 202 + struct mipi_dsi_msg *msg) 209 203 { 210 204 const struct mipi_dsi_host_ops *ops = dsi->host->ops; 205 + 206 + if (!ops || !ops->transfer) 207 + return -ENOSYS; 208 + 209 + if (dsi->mode_flags & MIPI_DSI_MODE_LPM) 210 + msg->flags |= MIPI_DSI_MSG_USE_LPM; 211 + 212 + return ops->transfer(dsi->host, msg); 213 + } 214 + 215 + /** 216 + * mipi_dsi_packet_format_is_short - check if a packet is of the short format 217 + * @type: MIPI DSI data type of the packet 218 + * 219 + * Return: true if the packet for the given data type is a short packet, false 220 + * otherwise. 221 + */ 222 + bool mipi_dsi_packet_format_is_short(u8 type) 223 + { 224 + switch (type) { 225 + case MIPI_DSI_V_SYNC_START: 226 + case MIPI_DSI_V_SYNC_END: 227 + case MIPI_DSI_H_SYNC_START: 228 + case MIPI_DSI_H_SYNC_END: 229 + case MIPI_DSI_END_OF_TRANSMISSION: 230 + case MIPI_DSI_COLOR_MODE_OFF: 231 + case MIPI_DSI_COLOR_MODE_ON: 232 + case MIPI_DSI_SHUTDOWN_PERIPHERAL: 233 + case MIPI_DSI_TURN_ON_PERIPHERAL: 234 + case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM: 235 + case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM: 236 + case MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM: 237 + case MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM: 238 + case MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM: 239 + case MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM: 240 + case MIPI_DSI_DCS_SHORT_WRITE: 241 + case MIPI_DSI_DCS_SHORT_WRITE_PARAM: 242 + case MIPI_DSI_DCS_READ: 243 + case MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE: 244 + return true; 245 + } 246 + 247 + return false; 248 + } 249 + EXPORT_SYMBOL(mipi_dsi_packet_format_is_short); 250 + 251 + /** 252 + * mipi_dsi_packet_format_is_long - check if a packet is of the long format 253 + * @type: MIPI DSI data type of the packet 254 + * 255 + * Return: true if the packet for the given data type is a long packet, false 256 + * otherwise. 257 + */ 258 + bool mipi_dsi_packet_format_is_long(u8 type) 259 + { 260 + switch (type) { 261 + case MIPI_DSI_NULL_PACKET: 262 + case MIPI_DSI_BLANKING_PACKET: 263 + case MIPI_DSI_GENERIC_LONG_WRITE: 264 + case MIPI_DSI_DCS_LONG_WRITE: 265 + case MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20: 266 + case MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24: 267 + case MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16: 268 + case MIPI_DSI_PACKED_PIXEL_STREAM_30: 269 + case MIPI_DSI_PACKED_PIXEL_STREAM_36: 270 + case MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12: 271 + case MIPI_DSI_PACKED_PIXEL_STREAM_16: 272 + case MIPI_DSI_PACKED_PIXEL_STREAM_18: 273 + case MIPI_DSI_PIXEL_STREAM_3BYTE_18: 274 + case MIPI_DSI_PACKED_PIXEL_STREAM_24: 275 + return true; 276 + } 277 + 278 + return false; 279 + } 280 + EXPORT_SYMBOL(mipi_dsi_packet_format_is_long); 281 + 282 + /** 283 + * mipi_dsi_create_packet - create a packet from a message according to the 284 + * DSI protocol 285 + * @packet: pointer to a DSI packet structure 286 + * @msg: message to translate into a packet 287 + * 288 + * Return: 0 on success or a negative error code on failure. 289 + */ 290 + int mipi_dsi_create_packet(struct mipi_dsi_packet *packet, 291 + const struct mipi_dsi_msg *msg) 292 + { 293 + const u8 *tx = msg->tx_buf; 294 + 295 + if (!packet || !msg) 296 + return -EINVAL; 297 + 298 + /* do some minimum sanity checking */ 299 + if (!mipi_dsi_packet_format_is_short(msg->type) && 300 + !mipi_dsi_packet_format_is_long(msg->type)) 301 + return -EINVAL; 302 + 303 + if (msg->channel > 3) 304 + return -EINVAL; 305 + 306 + memset(packet, 0, sizeof(*packet)); 307 + packet->header[0] = ((msg->channel & 0x3) << 6) | (msg->type & 0x3f); 308 + 309 + /* TODO: compute ECC if hardware support is not available */ 310 + 311 + /* 312 + * Long write packets contain the word count in header bytes 1 and 2. 313 + * The payload follows the header and is word count bytes long. 314 + * 315 + * Short write packets encode up to two parameters in header bytes 1 316 + * and 2. 317 + */ 318 + if (mipi_dsi_packet_format_is_long(msg->type)) { 319 + packet->header[1] = (msg->tx_len >> 0) & 0xff; 320 + packet->header[2] = (msg->tx_len >> 8) & 0xff; 321 + 322 + packet->payload_length = msg->tx_len; 323 + packet->payload = tx; 324 + } else { 325 + packet->header[1] = (msg->tx_len > 0) ? tx[0] : 0; 326 + packet->header[2] = (msg->tx_len > 1) ? tx[1] : 0; 327 + } 328 + 329 + packet->size = sizeof(packet->header) + packet->payload_length; 330 + 331 + return 0; 332 + } 333 + EXPORT_SYMBOL(mipi_dsi_create_packet); 334 + 335 + /** 336 + * mipi_dsi_dcs_write_buffer() - transmit a DCS command with payload 337 + * @dsi: DSI peripheral device 338 + * @data: buffer containing data to be transmitted 339 + * @len: size of transmission buffer 340 + * 341 + * This function will automatically choose the right data type depending on 342 + * the command payload length. 343 + * 344 + * Return: The number of bytes successfully transmitted or a negative error 345 + * code on failure. 346 + */ 347 + ssize_t mipi_dsi_dcs_write_buffer(struct mipi_dsi_device *dsi, 348 + const void *data, size_t len) 349 + { 211 350 struct mipi_dsi_msg msg = { 212 351 .channel = dsi->channel, 213 352 .tx_buf = data, 214 353 .tx_len = len 215 354 }; 216 355 217 - if (!ops || !ops->transfer) 218 - return -ENOSYS; 219 - 220 356 switch (len) { 221 357 case 0: 222 358 return -EINVAL; 359 + 223 360 case 1: 224 361 msg.type = MIPI_DSI_DCS_SHORT_WRITE; 225 362 break; 363 + 226 364 case 2: 227 365 msg.type = MIPI_DSI_DCS_SHORT_WRITE_PARAM; 228 366 break; 367 + 229 368 default: 230 369 msg.type = MIPI_DSI_DCS_LONG_WRITE; 231 370 break; 232 371 } 233 372 234 - if (dsi->mode_flags & MIPI_DSI_MODE_LPM) 235 - msg.flags = MIPI_DSI_MSG_USE_LPM; 373 + return mipi_dsi_device_transfer(dsi, &msg); 374 + } 375 + EXPORT_SYMBOL(mipi_dsi_dcs_write_buffer); 236 376 237 - return ops->transfer(dsi->host, &msg); 377 + /** 378 + * mipi_dsi_dcs_write() - send DCS write command 379 + * @dsi: DSI peripheral device 380 + * @cmd: DCS command 381 + * @data: buffer containing the command payload 382 + * @len: command payload length 383 + * 384 + * This function will automatically choose the right data type depending on 385 + * the command payload length. 386 + * 387 + * Return: The number of bytes successfully transmitted or a negative error 388 + * code on failure. 389 + */ 390 + ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, u8 cmd, 391 + const void *data, size_t len) 392 + { 393 + ssize_t err; 394 + size_t size; 395 + u8 *tx; 396 + 397 + if (len > 0) { 398 + size = 1 + len; 399 + 400 + tx = kmalloc(size, GFP_KERNEL); 401 + if (!tx) 402 + return -ENOMEM; 403 + 404 + /* concatenate the DCS command byte and the payload */ 405 + tx[0] = cmd; 406 + memcpy(&tx[1], data, len); 407 + } else { 408 + tx = &cmd; 409 + size = 1; 410 + } 411 + 412 + err = mipi_dsi_dcs_write_buffer(dsi, tx, size); 413 + 414 + if (len > 0) 415 + kfree(tx); 416 + 417 + return err; 238 418 } 239 419 EXPORT_SYMBOL(mipi_dsi_dcs_write); 240 420 241 421 /** 242 - * mipi_dsi_dcs_read - send DCS read request command 243 - * @dsi: DSI device 244 - * @cmd: DCS read command 245 - * @data: pointer to read buffer 246 - * @len: length of @data 422 + * mipi_dsi_dcs_read() - send DCS read request command 423 + * @dsi: DSI peripheral device 424 + * @cmd: DCS command 425 + * @data: buffer in which to receive data 426 + * @len: size of receive buffer 247 427 * 248 - * Function returns number of read bytes or error code. 428 + * Return: The number of bytes read or a negative error code on failure. 249 429 */ 250 430 ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data, 251 431 size_t len) 252 432 { 253 - const struct mipi_dsi_host_ops *ops = dsi->host->ops; 254 433 struct mipi_dsi_msg msg = { 255 434 .channel = dsi->channel, 256 435 .type = MIPI_DSI_DCS_READ, ··· 439 260 .rx_len = len 440 261 }; 441 262 442 - if (!ops || !ops->transfer) 443 - return -ENOSYS; 444 - 445 - if (dsi->mode_flags & MIPI_DSI_MODE_LPM) 446 - msg.flags = MIPI_DSI_MSG_USE_LPM; 447 - 448 - return ops->transfer(dsi->host, &msg); 263 + return mipi_dsi_device_transfer(dsi, &msg); 449 264 } 450 265 EXPORT_SYMBOL(mipi_dsi_dcs_read); 451 266
+1 -1
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1236 1236 } 1237 1237 1238 1238 static ssize_t exynos_dsi_host_transfer(struct mipi_dsi_host *host, 1239 - struct mipi_dsi_msg *msg) 1239 + const struct mipi_dsi_msg *msg) 1240 1240 { 1241 1241 struct exynos_dsi *dsi = host_to_dsi(host); 1242 1242 struct exynos_dsi_transfer xfer;
+4 -9
drivers/gpu/drm/panel/panel-ld9040.c
··· 145 145 if (ctx->error < 0 || len == 0) 146 146 return; 147 147 148 - dev_dbg(ctx->dev, "writing dcs seq: %*ph\n", len, data); 148 + dev_dbg(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data); 149 149 ret = ld9040_spi_write_word(ctx, *data); 150 150 151 151 while (!ret && --len) { ··· 154 154 } 155 155 156 156 if (ret) { 157 - dev_err(ctx->dev, "error %d writing dcs seq: %*ph\n", ret, len, 158 - data); 157 + dev_err(ctx->dev, "error %d writing dcs seq: %*ph\n", ret, 158 + (int)len, data); 159 159 ctx->error = ret; 160 160 } 161 161 ··· 336 336 if (ret < 0) 337 337 return ret; 338 338 339 - ctx->reset_gpio = devm_gpiod_get(dev, "reset"); 339 + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); 340 340 if (IS_ERR(ctx->reset_gpio)) { 341 341 dev_err(dev, "cannot get reset-gpios %ld\n", 342 342 PTR_ERR(ctx->reset_gpio)); 343 343 return PTR_ERR(ctx->reset_gpio); 344 - } 345 - ret = gpiod_direction_output(ctx->reset_gpio, 1); 346 - if (ret < 0) { 347 - dev_err(dev, "cannot configure reset-gpios %d\n", ret); 348 - return ret; 349 344 } 350 345 351 346 spi->bits_per_word = 9;
+4 -9
drivers/gpu/drm/panel/panel-s6e8aa0.c
··· 141 141 if (ctx->error < 0) 142 142 return; 143 143 144 - ret = mipi_dsi_dcs_write(dsi, data, len); 144 + ret = mipi_dsi_dcs_write_buffer(dsi, data, len); 145 145 if (ret < 0) { 146 - dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret, len, 147 - data); 146 + dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret, 147 + (int)len, data); 148 148 ctx->error = ret; 149 149 } 150 150 } ··· 1019 1019 return ret; 1020 1020 } 1021 1021 1022 - ctx->reset_gpio = devm_gpiod_get(dev, "reset"); 1022 + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); 1023 1023 if (IS_ERR(ctx->reset_gpio)) { 1024 1024 dev_err(dev, "cannot get reset-gpios %ld\n", 1025 1025 PTR_ERR(ctx->reset_gpio)); 1026 1026 return PTR_ERR(ctx->reset_gpio); 1027 - } 1028 - ret = gpiod_direction_output(ctx->reset_gpio, 1); 1029 - if (ret < 0) { 1030 - dev_err(dev, "cannot configure reset-gpios %d\n", ret); 1031 - return ret; 1032 1027 } 1033 1028 1034 1029 ctx->brightness = GAMMA_LEVEL_NUM - 1;
+117 -15
drivers/gpu/drm/panel/panel-simple.c
··· 247 247 if (IS_ERR(panel->supply)) 248 248 return PTR_ERR(panel->supply); 249 249 250 - panel->enable_gpio = devm_gpiod_get_optional(dev, "enable"); 250 + panel->enable_gpio = devm_gpiod_get_optional(dev, "enable", 251 + GPIOD_OUT_LOW); 251 252 if (IS_ERR(panel->enable_gpio)) { 252 253 err = PTR_ERR(panel->enable_gpio); 253 254 dev_err(dev, "failed to request GPIO: %d\n", err); 254 255 return err; 255 - } 256 - 257 - if (panel->enable_gpio) { 258 - err = gpiod_direction_output(panel->enable_gpio, 0); 259 - if (err < 0) { 260 - dev_err(dev, "failed to setup GPIO: %d\n", err); 261 - return err; 262 - } 263 256 } 264 257 265 258 backlight = of_parse_phandle(dev->of_node, "backlight", 0); ··· 369 376 }, 370 377 }; 371 378 379 + static const struct drm_display_mode auo_b116xw03_mode = { 380 + .clock = 70589, 381 + .hdisplay = 1366, 382 + .hsync_start = 1366 + 40, 383 + .hsync_end = 1366 + 40 + 40, 384 + .htotal = 1366 + 40 + 40 + 32, 385 + .vdisplay = 768, 386 + .vsync_start = 768 + 10, 387 + .vsync_end = 768 + 10 + 12, 388 + .vtotal = 768 + 10 + 12 + 6, 389 + .vrefresh = 60, 390 + }; 391 + 392 + static const struct panel_desc auo_b116xw03 = { 393 + .modes = &auo_b116xw03_mode, 394 + .num_modes = 1, 395 + .bpc = 6, 396 + .size = { 397 + .width = 256, 398 + .height = 144, 399 + }, 400 + }; 401 + 372 402 static const struct drm_display_mode auo_b133xtn01_mode = { 373 403 .clock = 69500, 374 404 .hdisplay = 1366, ··· 431 415 static const struct panel_desc auo_b133htn01 = { 432 416 .modes = &auo_b133htn01_mode, 433 417 .num_modes = 1, 418 + .bpc = 6, 434 419 .size = { 435 420 .width = 293, 436 421 .height = 165, ··· 553 536 static const struct panel_desc foxlink_fl500wvr00_a0t = { 554 537 .modes = &foxlink_fl500wvr00_a0t_mode, 555 538 .num_modes = 1, 539 + .bpc = 8, 556 540 .size = { 557 541 .width = 108, 558 542 .height = 65, 559 543 }, 560 544 }; 561 545 562 - static const struct drm_display_mode innolux_n116bge_mode = { 546 + static const struct drm_display_mode hannstar_hsd070pww1_mode = { 547 + .clock = 71100, 548 + .hdisplay = 1280, 549 + .hsync_start = 1280 + 1, 550 + .hsync_end = 1280 + 1 + 158, 551 + .htotal = 1280 + 1 + 158 + 1, 552 + .vdisplay = 800, 553 + .vsync_start = 800 + 1, 554 + .vsync_end = 800 + 1 + 21, 555 + .vtotal = 800 + 1 + 21 + 1, 556 + .vrefresh = 60, 557 + }; 558 + 559 + static const struct panel_desc hannstar_hsd070pww1 = { 560 + .modes = &hannstar_hsd070pww1_mode, 561 + .num_modes = 1, 562 + .bpc = 6, 563 + .size = { 564 + .width = 151, 565 + .height = 94, 566 + }, 567 + }; 568 + 569 + static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = { 570 + .clock = 33333, 571 + .hdisplay = 800, 572 + .hsync_start = 800 + 85, 573 + .hsync_end = 800 + 85 + 86, 574 + .htotal = 800 + 85 + 86 + 85, 575 + .vdisplay = 480, 576 + .vsync_start = 480 + 16, 577 + .vsync_end = 480 + 16 + 13, 578 + .vtotal = 480 + 16 + 13 + 16, 579 + .vrefresh = 60, 580 + }; 581 + 582 + static const struct panel_desc hitachi_tx23d38vm0caa = { 583 + .modes = &hitachi_tx23d38vm0caa_mode, 584 + .num_modes = 1, 585 + .bpc = 6, 586 + .size = { 587 + .width = 195, 588 + .height = 117, 589 + }, 590 + }; 591 + 592 + static const struct drm_display_mode innolux_g121i1_l01_mode = { 563 593 .clock = 71000, 594 + .hdisplay = 1280, 595 + .hsync_start = 1280 + 64, 596 + .hsync_end = 1280 + 64 + 32, 597 + .htotal = 1280 + 64 + 32 + 64, 598 + .vdisplay = 800, 599 + .vsync_start = 800 + 9, 600 + .vsync_end = 800 + 9 + 6, 601 + .vtotal = 800 + 9 + 6 + 9, 602 + .vrefresh = 60, 603 + }; 604 + 605 + static const struct panel_desc innolux_g121i1_l01 = { 606 + .modes = &innolux_g121i1_l01_mode, 607 + .num_modes = 1, 608 + .bpc = 6, 609 + .size = { 610 + .width = 261, 611 + .height = 163, 612 + }, 613 + }; 614 + 615 + static const struct drm_display_mode innolux_n116bge_mode = { 616 + .clock = 76420, 564 617 .hdisplay = 1366, 565 - .hsync_start = 1366 + 64, 566 - .hsync_end = 1366 + 64 + 6, 567 - .htotal = 1366 + 64 + 6 + 64, 618 + .hsync_start = 1366 + 136, 619 + .hsync_end = 1366 + 136 + 30, 620 + .htotal = 1366 + 136 + 30 + 60, 568 621 .vdisplay = 768, 569 622 .vsync_start = 768 + 8, 570 - .vsync_end = 768 + 8 + 4, 571 - .vtotal = 768 + 8 + 4 + 8, 623 + .vsync_end = 768 + 8 + 12, 624 + .vtotal = 768 + 8 + 12 + 12, 572 625 .vrefresh = 60, 573 626 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, 574 627 }; ··· 730 643 .compatible = "auo,b101xtn01", 731 644 .data = &auo_b101xtn01, 732 645 }, { 646 + .compatible = "auo,b116xw03", 647 + .data = &auo_b116xw03, 648 + }, { 733 649 .compatible = "auo,b133htn01", 734 650 .data = &auo_b133htn01, 735 651 }, { ··· 756 666 }, { 757 667 .compatible = "foxlink,fl500wvr00-a0t", 758 668 .data = &foxlink_fl500wvr00_a0t, 669 + }, { 670 + .compatible = "hannstar,hsd070pww1", 671 + .data = &hannstar_hsd070pww1, 672 + }, { 673 + .compatible = "hit,tx23d38vm0caa", 674 + .data = &hitachi_tx23d38vm0caa 675 + }, { 676 + .compatible ="innolux,g121i1-l01", 677 + .data = &innolux_g121i1_l01 759 678 }, { 760 679 .compatible = "innolux,n116bge", 761 680 .data = &innolux_n116bge, ··· 840 741 .desc = { 841 742 .modes = &lg_ld070wx3_sl01_mode, 842 743 .num_modes = 1, 744 + .bpc = 8, 843 745 .size = { 844 746 .width = 94, 845 747 .height = 151, ··· 868 768 .desc = { 869 769 .modes = &lg_lh500wx1_sd03_mode, 870 770 .num_modes = 1, 771 + .bpc = 8, 871 772 .size = { 872 773 .width = 62, 873 774 .height = 110, ··· 896 795 .desc = { 897 796 .modes = &panasonic_vvx10f004b00_mode, 898 797 .num_modes = 1, 798 + .bpc = 8, 899 799 .size = { 900 800 .width = 217, 901 801 .height = 136,
+26 -3
include/drm/drm_mipi_dsi.h
··· 43 43 void *rx_buf; 44 44 }; 45 45 46 + bool mipi_dsi_packet_format_is_short(u8 type); 47 + bool mipi_dsi_packet_format_is_long(u8 type); 48 + 49 + /** 50 + * struct mipi_dsi_packet - represents a MIPI DSI packet in protocol format 51 + * @size: size (in bytes) of the packet 52 + * @header: the four bytes that make up the header (Data ID, Word Count or 53 + * Packet Data, and ECC) 54 + * @payload_length: number of bytes in the payload 55 + * @payload: a pointer to a buffer containing the payload, if any 56 + */ 57 + struct mipi_dsi_packet { 58 + size_t size; 59 + u8 header[4]; 60 + size_t payload_length; 61 + const u8 *payload; 62 + }; 63 + 64 + int mipi_dsi_create_packet(struct mipi_dsi_packet *packet, 65 + const struct mipi_dsi_msg *msg); 66 + 46 67 /** 47 68 * struct mipi_dsi_host_ops - DSI bus operations 48 69 * @attach: attach DSI device to DSI host ··· 77 56 int (*detach)(struct mipi_dsi_host *host, 78 57 struct mipi_dsi_device *dsi); 79 58 ssize_t (*transfer)(struct mipi_dsi_host *host, 80 - struct mipi_dsi_msg *msg); 59 + const struct mipi_dsi_msg *msg); 81 60 }; 82 61 83 62 /** ··· 153 132 154 133 int mipi_dsi_attach(struct mipi_dsi_device *dsi); 155 134 int mipi_dsi_detach(struct mipi_dsi_device *dsi); 156 - ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, const void *data, 157 - size_t len); 135 + ssize_t mipi_dsi_dcs_write_buffer(struct mipi_dsi_device *dsi, 136 + const void *data, size_t len); 137 + ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, u8 cmd, 138 + const void *data, size_t len); 158 139 ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data, 159 140 size_t len); 160 141