Lines Matching +full:mipi +full:- +full:dsi

2  * MIPI DSI Bus
4 * Copyright (C) 2012-2013, Samsung Electronics, Co., Ltd.
21 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
42 * DOC: dsi helpers
44 * These functions contain some common logic and helpers to deal with MIPI DSI
47 * Helpers are provided for a number of standard MIPI DSI command as well as a
48 * subset of the MIPI DCS command set.
53 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_device_match() local
59 /* compare DSI device and driver names */ in mipi_dsi_device_match()
60 if (!strcmp(dsi->name, drv->name)) in mipi_dsi_device_match()
68 const struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_uevent() local
72 if (err != -ENODEV) in mipi_dsi_uevent()
76 dsi->name); in mipi_dsi_uevent()
93 .name = "mipi-dsi",
100 * of_find_mipi_dsi_device_by_node() - find the MIPI DSI device matching a
104 * Return: A pointer to the MIPI DSI device corresponding to @np or NULL if no
119 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_dev_release() local
121 of_node_put(dev->of_node); in mipi_dsi_dev_release()
122 kfree(dsi); in mipi_dsi_dev_release()
131 struct mipi_dsi_device *dsi; in mipi_dsi_device_alloc() local
133 dsi = kzalloc(sizeof(*dsi), GFP_KERNEL); in mipi_dsi_device_alloc()
134 if (!dsi) in mipi_dsi_device_alloc()
135 return ERR_PTR(-ENOMEM); in mipi_dsi_device_alloc()
137 dsi->host = host; in mipi_dsi_device_alloc()
138 dsi->dev.bus = &mipi_dsi_bus_type; in mipi_dsi_device_alloc()
139 dsi->dev.parent = host->dev; in mipi_dsi_device_alloc()
140 dsi->dev.type = &mipi_dsi_device_type; in mipi_dsi_device_alloc()
142 device_initialize(&dsi->dev); in mipi_dsi_device_alloc()
144 return dsi; in mipi_dsi_device_alloc()
147 static int mipi_dsi_device_add(struct mipi_dsi_device *dsi) in mipi_dsi_device_add() argument
149 struct mipi_dsi_host *host = dsi->host; in mipi_dsi_device_add()
151 dev_set_name(&dsi->dev, "%s.%d", dev_name(host->dev), dsi->channel); in mipi_dsi_device_add()
153 return device_add(&dsi->dev); in mipi_dsi_device_add()
166 return ERR_PTR(-EINVAL); in of_mipi_dsi_device_add()
173 return ERR_PTR(-EINVAL); in of_mipi_dsi_device_add()
185 return ERR_PTR(-ENODEV); in of_mipi_dsi_device_add()
190 * mipi_dsi_device_register_full - create a MIPI DSI device
191 * @host: DSI host to which this device is connected
192 * @info: pointer to template containing DSI device information
194 * Create a MIPI DSI device by using the device information provided by
198 * A pointer to the newly created MIPI DSI device, or, a pointer encoded
205 struct mipi_dsi_device *dsi; in mipi_dsi_device_register_full() local
210 return ERR_PTR(-EINVAL); in mipi_dsi_device_register_full()
213 if (info->channel > 3) { in mipi_dsi_device_register_full()
214 drm_err(host, "invalid virtual channel: %u\n", info->channel); in mipi_dsi_device_register_full()
215 return ERR_PTR(-EINVAL); in mipi_dsi_device_register_full()
218 dsi = mipi_dsi_device_alloc(host); in mipi_dsi_device_register_full()
219 if (IS_ERR(dsi)) { in mipi_dsi_device_register_full()
220 drm_err(host, "failed to allocate DSI device %ld\n", in mipi_dsi_device_register_full()
221 PTR_ERR(dsi)); in mipi_dsi_device_register_full()
222 return dsi; in mipi_dsi_device_register_full()
225 device_set_node(&dsi->dev, of_fwnode_handle(info->node)); in mipi_dsi_device_register_full()
226 dsi->channel = info->channel; in mipi_dsi_device_register_full()
227 strscpy(dsi->name, info->type, sizeof(dsi->name)); in mipi_dsi_device_register_full()
229 ret = mipi_dsi_device_add(dsi); in mipi_dsi_device_register_full()
231 drm_err(host, "failed to add DSI device %d\n", ret); in mipi_dsi_device_register_full()
232 kfree(dsi); in mipi_dsi_device_register_full()
236 return dsi; in mipi_dsi_device_register_full()
241 * mipi_dsi_device_unregister - unregister MIPI DSI device
242 * @dsi: DSI peripheral device
244 void mipi_dsi_device_unregister(struct mipi_dsi_device *dsi) in mipi_dsi_device_unregister() argument
246 device_unregister(&dsi->dev); in mipi_dsi_device_unregister()
252 struct mipi_dsi_device *dsi = arg; in devm_mipi_dsi_device_unregister() local
254 mipi_dsi_device_unregister(dsi); in devm_mipi_dsi_device_unregister()
258 * devm_mipi_dsi_device_register_full - create a managed MIPI DSI device
259 * @dev: device to tie the MIPI-DSI device lifetime to
260 * @host: DSI host to which this device is connected
261 * @info: pointer to template containing DSI device information
263 * Create a MIPI DSI device by using the device information provided by
271 * A pointer to the newly created MIPI DSI device, or, a pointer encoded
279 struct mipi_dsi_device *dsi; in devm_mipi_dsi_device_register_full() local
282 dsi = mipi_dsi_device_register_full(host, info); in devm_mipi_dsi_device_register_full()
283 if (IS_ERR(dsi)) in devm_mipi_dsi_device_register_full()
284 return dsi; in devm_mipi_dsi_device_register_full()
288 dsi); in devm_mipi_dsi_device_register_full()
292 return dsi; in devm_mipi_dsi_device_register_full()
300 * of_find_mipi_dsi_host_by_node() - find the MIPI DSI host matching a
305 * A pointer to the MIPI DSI host corresponding to @node or NULL if no
315 if (host->dev->of_node == node) { in of_find_mipi_dsi_host_by_node()
331 for_each_available_child_of_node(host->dev->of_node, node) { in mipi_dsi_host_register()
339 list_add_tail(&host->list, &host_list); in mipi_dsi_host_register()
348 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_remove_device_fn() local
350 if (dsi->attached) in mipi_dsi_remove_device_fn()
351 mipi_dsi_detach(dsi); in mipi_dsi_remove_device_fn()
352 mipi_dsi_device_unregister(dsi); in mipi_dsi_remove_device_fn()
359 device_for_each_child(host->dev, NULL, mipi_dsi_remove_device_fn); in mipi_dsi_host_unregister()
362 list_del_init(&host->list); in mipi_dsi_host_unregister()
368 * mipi_dsi_attach - attach a DSI device to its DSI host
369 * @dsi: DSI peripheral
371 int mipi_dsi_attach(struct mipi_dsi_device *dsi) in mipi_dsi_attach() argument
373 const struct mipi_dsi_host_ops *ops = dsi->host->ops; in mipi_dsi_attach()
376 if (!ops || !ops->attach) in mipi_dsi_attach()
377 return -ENOSYS; in mipi_dsi_attach()
379 ret = ops->attach(dsi->host, dsi); in mipi_dsi_attach()
383 dsi->attached = true; in mipi_dsi_attach()
390 * mipi_dsi_detach - detach a DSI device from its DSI host
391 * @dsi: DSI peripheral
393 int mipi_dsi_detach(struct mipi_dsi_device *dsi) in mipi_dsi_detach() argument
395 const struct mipi_dsi_host_ops *ops = dsi->host->ops; in mipi_dsi_detach()
397 if (WARN_ON(!dsi->attached)) in mipi_dsi_detach()
398 return -EINVAL; in mipi_dsi_detach()
400 if (!ops || !ops->detach) in mipi_dsi_detach()
401 return -ENOSYS; in mipi_dsi_detach()
403 dsi->attached = false; in mipi_dsi_detach()
405 return ops->detach(dsi->host, dsi); in mipi_dsi_detach()
411 struct mipi_dsi_device *dsi = arg; in devm_mipi_dsi_detach() local
413 mipi_dsi_detach(dsi); in devm_mipi_dsi_detach()
417 * devm_mipi_dsi_attach - Attach a MIPI-DSI device to its DSI Host
418 * @dev: device to tie the MIPI-DSI device attachment lifetime to
419 * @dsi: DSI peripheral
428 struct mipi_dsi_device *dsi) in devm_mipi_dsi_attach() argument
432 ret = mipi_dsi_attach(dsi); in devm_mipi_dsi_attach()
436 ret = devm_add_action_or_reset(dev, devm_mipi_dsi_detach, dsi); in devm_mipi_dsi_attach()
444 static ssize_t mipi_dsi_device_transfer(struct mipi_dsi_device *dsi, in mipi_dsi_device_transfer() argument
447 const struct mipi_dsi_host_ops *ops = dsi->host->ops; in mipi_dsi_device_transfer()
449 if (!ops || !ops->transfer) in mipi_dsi_device_transfer()
450 return -ENOSYS; in mipi_dsi_device_transfer()
452 if (dsi->mode_flags & MIPI_DSI_MODE_LPM) in mipi_dsi_device_transfer()
453 msg->flags |= MIPI_DSI_MSG_USE_LPM; in mipi_dsi_device_transfer()
455 return ops->transfer(dsi->host, msg); in mipi_dsi_device_transfer()
459 * mipi_dsi_packet_format_is_short - check if a packet is of the short format
460 * @type: MIPI DSI data type of the packet
497 * mipi_dsi_packet_format_is_long - check if a packet is of the long format
498 * @type: MIPI DSI data type of the packet
530 * mipi_dsi_create_packet - create a packet from a message according to the
531 * DSI protocol
532 * @packet: pointer to a DSI packet structure
541 return -EINVAL; in mipi_dsi_create_packet()
544 if (!mipi_dsi_packet_format_is_short(msg->type) && in mipi_dsi_create_packet()
545 !mipi_dsi_packet_format_is_long(msg->type)) in mipi_dsi_create_packet()
546 return -EINVAL; in mipi_dsi_create_packet()
548 if (msg->channel > 3) in mipi_dsi_create_packet()
549 return -EINVAL; in mipi_dsi_create_packet()
552 packet->header[0] = ((msg->channel & 0x3) << 6) | (msg->type & 0x3f); in mipi_dsi_create_packet()
563 if (mipi_dsi_packet_format_is_long(msg->type)) { in mipi_dsi_create_packet()
564 packet->header[1] = (msg->tx_len >> 0) & 0xff; in mipi_dsi_create_packet()
565 packet->header[2] = (msg->tx_len >> 8) & 0xff; in mipi_dsi_create_packet()
567 packet->payload_length = msg->tx_len; in mipi_dsi_create_packet()
568 packet->payload = msg->tx_buf; in mipi_dsi_create_packet()
570 const u8 *tx = msg->tx_buf; in mipi_dsi_create_packet()
572 packet->header[1] = (msg->tx_len > 0) ? tx[0] : 0; in mipi_dsi_create_packet()
573 packet->header[2] = (msg->tx_len > 1) ? tx[1] : 0; in mipi_dsi_create_packet()
576 packet->size = sizeof(packet->header) + packet->payload_length; in mipi_dsi_create_packet()
583 * mipi_dsi_shutdown_peripheral() - sends a Shutdown Peripheral command
584 * @dsi: DSI peripheral device
588 int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi) in mipi_dsi_shutdown_peripheral() argument
591 .channel = dsi->channel, in mipi_dsi_shutdown_peripheral()
596 int ret = mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_shutdown_peripheral()
603 * mipi_dsi_turn_on_peripheral() - sends a Turn On Peripheral command
604 * @dsi: DSI peripheral device
610 int mipi_dsi_turn_on_peripheral(struct mipi_dsi_device *dsi) in mipi_dsi_turn_on_peripheral() argument
613 .channel = dsi->channel, in mipi_dsi_turn_on_peripheral()
618 int ret = mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_turn_on_peripheral()
625 * mipi_dsi_set_maximum_return_packet_size() - specify the maximum size of
628 * @dsi: DSI peripheral device
633 int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi, in mipi_dsi_set_maximum_return_packet_size() argument
638 .channel = dsi->channel, in mipi_dsi_set_maximum_return_packet_size()
643 int ret = mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_set_maximum_return_packet_size()
650 * mipi_dsi_compression_mode_ext() - enable/disable DSC on the peripheral
651 * @dsi: DSI peripheral device
654 * @pps_selector: Select PPS from the table of pre-stored or uploaded PPS entries
661 int mipi_dsi_compression_mode_ext(struct mipi_dsi_device *dsi, bool enable, in mipi_dsi_compression_mode_ext() argument
667 .channel = dsi->channel, in mipi_dsi_compression_mode_ext()
675 return -EINVAL; in mipi_dsi_compression_mode_ext()
681 ret = mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_compression_mode_ext()
688 * mipi_dsi_compression_mode() - enable/disable DSC on the peripheral
689 * @dsi: DSI peripheral device
697 int mipi_dsi_compression_mode(struct mipi_dsi_device *dsi, bool enable) in mipi_dsi_compression_mode() argument
699 return mipi_dsi_compression_mode_ext(dsi, enable, MIPI_DSI_COMPRESSION_DSC, 0); in mipi_dsi_compression_mode()
704 * mipi_dsi_picture_parameter_set() - transmit the DSC PPS to the peripheral
705 * @dsi: DSI peripheral device
713 int mipi_dsi_picture_parameter_set(struct mipi_dsi_device *dsi, in mipi_dsi_picture_parameter_set() argument
717 .channel = dsi->channel, in mipi_dsi_picture_parameter_set()
722 int ret = mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_picture_parameter_set()
729 * mipi_dsi_generic_write() - transmit data using a generic write packet
730 * @dsi: DSI peripheral device
740 ssize_t mipi_dsi_generic_write(struct mipi_dsi_device *dsi, const void *payload, in mipi_dsi_generic_write() argument
744 .channel = dsi->channel, in mipi_dsi_generic_write()
767 return mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_generic_write()
772 * mipi_dsi_generic_write_chatty() - mipi_dsi_generic_write() w/ an error log
773 * @dsi: DSI peripheral device
782 int mipi_dsi_generic_write_chatty(struct mipi_dsi_device *dsi, in mipi_dsi_generic_write_chatty() argument
785 struct device *dev = &dsi->dev; in mipi_dsi_generic_write_chatty()
788 ret = mipi_dsi_generic_write(dsi, payload, size); in mipi_dsi_generic_write_chatty()
800 * mipi_dsi_generic_write_multi() - mipi_dsi_generic_write_chatty() w/ accum_err
801 * @ctx: Context for multiple DSI transactions
811 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_generic_write_multi() local
812 struct device *dev = &dsi->dev; in mipi_dsi_generic_write_multi()
815 if (ctx->accum_err) in mipi_dsi_generic_write_multi()
818 ret = mipi_dsi_generic_write(dsi, payload, size); in mipi_dsi_generic_write_multi()
820 ctx->accum_err = ret; in mipi_dsi_generic_write_multi()
822 (int)size, payload, ctx->accum_err); in mipi_dsi_generic_write_multi()
828 * mipi_dsi_generic_read() - receive data using a generic read packet
829 * @dsi: DSI peripheral device
841 ssize_t mipi_dsi_generic_read(struct mipi_dsi_device *dsi, const void *params, in mipi_dsi_generic_read() argument
845 .channel = dsi->channel, in mipi_dsi_generic_read()
866 return -EINVAL; in mipi_dsi_generic_read()
869 return mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_generic_read()
874 * mipi_dsi_dcs_write_buffer() - transmit a DCS command with payload
875 * @dsi: DSI peripheral device
885 ssize_t mipi_dsi_dcs_write_buffer(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_write_buffer() argument
889 .channel = dsi->channel, in mipi_dsi_dcs_write_buffer()
896 return -EINVAL; in mipi_dsi_dcs_write_buffer()
911 return mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_dcs_write_buffer()
916 * mipi_dsi_dcs_write_buffer_chatty - mipi_dsi_dcs_write_buffer() w/ an error log
917 * @dsi: DSI peripheral device
926 int mipi_dsi_dcs_write_buffer_chatty(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_write_buffer_chatty() argument
929 struct device *dev = &dsi->dev; in mipi_dsi_dcs_write_buffer_chatty()
932 ret = mipi_dsi_dcs_write_buffer(dsi, data, len); in mipi_dsi_dcs_write_buffer_chatty()
944 * mipi_dsi_dcs_write_buffer_multi - mipi_dsi_dcs_write_buffer_chatty() w/ accum_err
945 * @ctx: Context for multiple DSI transactions
955 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_write_buffer_multi() local
956 struct device *dev = &dsi->dev; in mipi_dsi_dcs_write_buffer_multi()
959 if (ctx->accum_err) in mipi_dsi_dcs_write_buffer_multi()
962 ret = mipi_dsi_dcs_write_buffer(dsi, data, len); in mipi_dsi_dcs_write_buffer_multi()
964 ctx->accum_err = ret; in mipi_dsi_dcs_write_buffer_multi()
966 (int)len, data, ctx->accum_err); in mipi_dsi_dcs_write_buffer_multi()
972 * mipi_dsi_dcs_write() - send DCS write command
973 * @dsi: DSI peripheral device
984 ssize_t mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, u8 cmd, in mipi_dsi_dcs_write() argument
993 if (len > ARRAY_SIZE(stack_tx) - 1) { in mipi_dsi_dcs_write()
996 return -ENOMEM; in mipi_dsi_dcs_write()
1006 err = mipi_dsi_dcs_write_buffer(dsi, tx, size); in mipi_dsi_dcs_write()
1016 * mipi_dsi_dcs_read() - send DCS read request command
1017 * @dsi: DSI peripheral device
1024 ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, u8 cmd, void *data, in mipi_dsi_dcs_read() argument
1028 .channel = dsi->channel, in mipi_dsi_dcs_read()
1036 return mipi_dsi_device_transfer(dsi, &msg); in mipi_dsi_dcs_read()
1041 * mipi_dsi_dcs_nop() - send DCS nop packet
1042 * @dsi: DSI peripheral device
1048 int mipi_dsi_dcs_nop(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_nop() argument
1052 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_NOP, NULL, 0); in mipi_dsi_dcs_nop()
1061 * mipi_dsi_dcs_soft_reset() - perform a software reset of the display module
1062 * @dsi: DSI peripheral device
1068 int mipi_dsi_dcs_soft_reset(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_soft_reset() argument
1072 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SOFT_RESET, NULL, 0); in mipi_dsi_dcs_soft_reset()
1081 * mipi_dsi_dcs_get_power_mode() - query the display module's current power
1083 * @dsi: DSI peripheral device
1088 int mipi_dsi_dcs_get_power_mode(struct mipi_dsi_device *dsi, u8 *mode) in mipi_dsi_dcs_get_power_mode() argument
1092 err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_POWER_MODE, mode, in mipi_dsi_dcs_get_power_mode()
1096 err = -ENODATA; in mipi_dsi_dcs_get_power_mode()
1106 * mipi_dsi_dcs_get_pixel_format() - gets the pixel format for the RGB image
1108 * @dsi: DSI peripheral device
1113 int mipi_dsi_dcs_get_pixel_format(struct mipi_dsi_device *dsi, u8 *format) in mipi_dsi_dcs_get_pixel_format() argument
1117 err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_PIXEL_FORMAT, format, in mipi_dsi_dcs_get_pixel_format()
1121 err = -ENODATA; in mipi_dsi_dcs_get_pixel_format()
1131 * mipi_dsi_dcs_enter_sleep_mode() - disable all unnecessary blocks inside the
1133 * @dsi: DSI peripheral device
1139 int mipi_dsi_dcs_enter_sleep_mode(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_enter_sleep_mode() argument
1143 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0); in mipi_dsi_dcs_enter_sleep_mode()
1152 * mipi_dsi_dcs_exit_sleep_mode() - enable all blocks inside the display
1154 * @dsi: DSI peripheral device
1160 int mipi_dsi_dcs_exit_sleep_mode(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_exit_sleep_mode() argument
1164 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0); in mipi_dsi_dcs_exit_sleep_mode()
1173 * mipi_dsi_dcs_set_display_off() - stop displaying the image data on the
1175 * @dsi: DSI peripheral device
1181 int mipi_dsi_dcs_set_display_off(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_set_display_off() argument
1185 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0); in mipi_dsi_dcs_set_display_off()
1194 * mipi_dsi_dcs_set_display_on() - start displaying the image data on the
1196 * @dsi: DSI peripheral device
1202 int mipi_dsi_dcs_set_display_on(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_set_display_on() argument
1206 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0); in mipi_dsi_dcs_set_display_on()
1215 * mipi_dsi_dcs_set_column_address() - define the column extent of the frame
1217 * @dsi: DSI peripheral device
1226 int mipi_dsi_dcs_set_column_address(struct mipi_dsi_device *dsi, u16 start, in mipi_dsi_dcs_set_column_address() argument
1232 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_COLUMN_ADDRESS, payload, in mipi_dsi_dcs_set_column_address()
1242 * mipi_dsi_dcs_set_page_address() - define the page extent of the frame
1244 * @dsi: DSI peripheral device
1253 int mipi_dsi_dcs_set_page_address(struct mipi_dsi_device *dsi, u16 start, in mipi_dsi_dcs_set_page_address() argument
1259 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_PAGE_ADDRESS, payload, in mipi_dsi_dcs_set_page_address()
1269 * mipi_dsi_dcs_set_tear_off() - turn off the display module's Tearing Effect
1271 * @dsi: DSI peripheral device
1275 int mipi_dsi_dcs_set_tear_off(struct mipi_dsi_device *dsi) in mipi_dsi_dcs_set_tear_off() argument
1279 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_TEAR_OFF, NULL, 0); in mipi_dsi_dcs_set_tear_off()
1288 * mipi_dsi_dcs_set_tear_on() - turn on the display module's Tearing Effect
1290 * @dsi: DSI peripheral device
1297 int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_set_tear_on() argument
1303 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_TEAR_ON, &value, in mipi_dsi_dcs_set_tear_on()
1313 * mipi_dsi_dcs_set_pixel_format() - sets the pixel format for the RGB image
1315 * @dsi: DSI peripheral device
1323 int mipi_dsi_dcs_set_pixel_format(struct mipi_dsi_device *dsi, u8 format) in mipi_dsi_dcs_set_pixel_format() argument
1327 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_PIXEL_FORMAT, &format, in mipi_dsi_dcs_set_pixel_format()
1337 * mipi_dsi_dcs_set_tear_scanline() - set the scanline to use as trigger for
1339 * @dsi: DSI peripheral device
1347 int mipi_dsi_dcs_set_tear_scanline(struct mipi_dsi_device *dsi, u16 scanline) in mipi_dsi_dcs_set_tear_scanline() argument
1352 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_TEAR_SCANLINE, payload, in mipi_dsi_dcs_set_tear_scanline()
1362 * mipi_dsi_dcs_set_display_brightness() - sets the brightness value of the
1364 * @dsi: DSI peripheral device
1372 int mipi_dsi_dcs_set_display_brightness(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_set_display_brightness() argument
1378 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, in mipi_dsi_dcs_set_display_brightness()
1388 * mipi_dsi_dcs_get_display_brightness() - gets the current brightness value
1390 * @dsi: DSI peripheral device
1395 int mipi_dsi_dcs_get_display_brightness(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_get_display_brightness() argument
1400 err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_DISPLAY_BRIGHTNESS, in mipi_dsi_dcs_get_display_brightness()
1404 err = -ENODATA; in mipi_dsi_dcs_get_display_brightness()
1414 * mipi_dsi_dcs_set_display_brightness_large() - sets the 16-bit brightness value
1416 * @dsi: DSI peripheral device
1421 int mipi_dsi_dcs_set_display_brightness_large(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_set_display_brightness_large() argument
1427 err = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, in mipi_dsi_dcs_set_display_brightness_large()
1437 * mipi_dsi_dcs_get_display_brightness_large() - gets the current 16-bit
1439 * @dsi: DSI peripheral device
1444 int mipi_dsi_dcs_get_display_brightness_large(struct mipi_dsi_device *dsi, in mipi_dsi_dcs_get_display_brightness_large() argument
1450 err = mipi_dsi_dcs_read(dsi, MIPI_DCS_GET_DISPLAY_BRIGHTNESS, in mipi_dsi_dcs_get_display_brightness_large()
1454 err = -ENODATA; in mipi_dsi_dcs_get_display_brightness_large()
1466 * mipi_dsi_picture_parameter_set_multi() - transmit the DSC PPS to the peripheral
1467 * @ctx: Context for multiple DSI transactions
1476 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_picture_parameter_set_multi() local
1477 struct device *dev = &dsi->dev; in mipi_dsi_picture_parameter_set_multi()
1480 if (ctx->accum_err) in mipi_dsi_picture_parameter_set_multi()
1483 ret = mipi_dsi_picture_parameter_set(dsi, pps); in mipi_dsi_picture_parameter_set_multi()
1485 ctx->accum_err = ret; in mipi_dsi_picture_parameter_set_multi()
1487 ctx->accum_err); in mipi_dsi_picture_parameter_set_multi()
1493 * mipi_dsi_compression_mode_ext_multi() - enable/disable DSC on the peripheral
1494 * @ctx: Context for multiple DSI transactions
1497 * @pps_selector: Select PPS from the table of pre-stored or uploaded PPS entries
1507 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_compression_mode_ext_multi() local
1508 struct device *dev = &dsi->dev; in mipi_dsi_compression_mode_ext_multi()
1511 if (ctx->accum_err) in mipi_dsi_compression_mode_ext_multi()
1514 ret = mipi_dsi_compression_mode_ext(dsi, enable, algo, pps_selector); in mipi_dsi_compression_mode_ext_multi()
1516 ctx->accum_err = ret; in mipi_dsi_compression_mode_ext_multi()
1518 ctx->accum_err); in mipi_dsi_compression_mode_ext_multi()
1524 * mipi_dsi_dcs_nop_multi() - send DCS NOP packet
1525 * @ctx: Context for multiple DSI transactions
1532 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_nop_multi() local
1533 struct device *dev = &dsi->dev; in mipi_dsi_dcs_nop_multi()
1536 if (ctx->accum_err) in mipi_dsi_dcs_nop_multi()
1539 ret = mipi_dsi_dcs_nop(dsi); in mipi_dsi_dcs_nop_multi()
1541 ctx->accum_err = ret; in mipi_dsi_dcs_nop_multi()
1543 ctx->accum_err); in mipi_dsi_dcs_nop_multi()
1549 * mipi_dsi_dcs_enter_sleep_mode_multi() - send DCS ENTER_SLEEP_MODE packet
1550 * @ctx: Context for multiple DSI transactions
1557 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_enter_sleep_mode_multi() local
1558 struct device *dev = &dsi->dev; in mipi_dsi_dcs_enter_sleep_mode_multi()
1561 if (ctx->accum_err) in mipi_dsi_dcs_enter_sleep_mode_multi()
1564 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in mipi_dsi_dcs_enter_sleep_mode_multi()
1566 ctx->accum_err = ret; in mipi_dsi_dcs_enter_sleep_mode_multi()
1568 ctx->accum_err); in mipi_dsi_dcs_enter_sleep_mode_multi()
1574 * mipi_dsi_dcs_exit_sleep_mode_multi() - send DCS EXIT_SLEEP_MODE packet
1575 * @ctx: Context for multiple DSI transactions
1582 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_exit_sleep_mode_multi() local
1583 struct device *dev = &dsi->dev; in mipi_dsi_dcs_exit_sleep_mode_multi()
1586 if (ctx->accum_err) in mipi_dsi_dcs_exit_sleep_mode_multi()
1589 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in mipi_dsi_dcs_exit_sleep_mode_multi()
1591 ctx->accum_err = ret; in mipi_dsi_dcs_exit_sleep_mode_multi()
1593 ctx->accum_err); in mipi_dsi_dcs_exit_sleep_mode_multi()
1599 * mipi_dsi_dcs_set_display_off_multi() - send DCS SET_DISPLAY_OFF packet
1600 * @ctx: Context for multiple DSI transactions
1607 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_display_off_multi() local
1608 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_display_off_multi()
1611 if (ctx->accum_err) in mipi_dsi_dcs_set_display_off_multi()
1614 ret = mipi_dsi_dcs_set_display_off(dsi); in mipi_dsi_dcs_set_display_off_multi()
1616 ctx->accum_err = ret; in mipi_dsi_dcs_set_display_off_multi()
1618 ctx->accum_err); in mipi_dsi_dcs_set_display_off_multi()
1624 * mipi_dsi_dcs_set_display_on_multi() - send DCS SET_DISPLAY_ON packet
1625 * @ctx: Context for multiple DSI transactions
1632 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_display_on_multi() local
1633 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_display_on_multi()
1636 if (ctx->accum_err) in mipi_dsi_dcs_set_display_on_multi()
1639 ret = mipi_dsi_dcs_set_display_on(dsi); in mipi_dsi_dcs_set_display_on_multi()
1641 ctx->accum_err = ret; in mipi_dsi_dcs_set_display_on_multi()
1643 ctx->accum_err); in mipi_dsi_dcs_set_display_on_multi()
1649 * mipi_dsi_dcs_set_tear_on_multi() - send DCS SET_TEAR_ON packet
1650 * @ctx: Context for multiple DSI transactions
1659 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_tear_on_multi() local
1660 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_tear_on_multi()
1663 if (ctx->accum_err) in mipi_dsi_dcs_set_tear_on_multi()
1666 ret = mipi_dsi_dcs_set_tear_on(dsi, mode); in mipi_dsi_dcs_set_tear_on_multi()
1668 ctx->accum_err = ret; in mipi_dsi_dcs_set_tear_on_multi()
1670 ctx->accum_err); in mipi_dsi_dcs_set_tear_on_multi()
1676 * mipi_dsi_turn_on_peripheral_multi() - sends a Turn On Peripheral command
1677 * @ctx: Context for multiple DSI transactions
1684 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_turn_on_peripheral_multi() local
1685 struct device *dev = &dsi->dev; in mipi_dsi_turn_on_peripheral_multi()
1688 if (ctx->accum_err) in mipi_dsi_turn_on_peripheral_multi()
1691 ret = mipi_dsi_turn_on_peripheral(dsi); in mipi_dsi_turn_on_peripheral_multi()
1693 ctx->accum_err = ret; in mipi_dsi_turn_on_peripheral_multi()
1695 ctx->accum_err); in mipi_dsi_turn_on_peripheral_multi()
1701 * mipi_dsi_dcs_soft_reset_multi() - perform a software reset of the display module
1702 * @ctx: Context for multiple DSI transactions
1709 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_soft_reset_multi() local
1710 struct device *dev = &dsi->dev; in mipi_dsi_dcs_soft_reset_multi()
1713 if (ctx->accum_err) in mipi_dsi_dcs_soft_reset_multi()
1716 ret = mipi_dsi_dcs_soft_reset(dsi); in mipi_dsi_dcs_soft_reset_multi()
1718 ctx->accum_err = ret; in mipi_dsi_dcs_soft_reset_multi()
1720 ctx->accum_err); in mipi_dsi_dcs_soft_reset_multi()
1726 * mipi_dsi_dcs_set_display_brightness_multi() - sets the brightness value of
1728 * @ctx: Context for multiple DSI transactions
1737 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_display_brightness_multi() local
1738 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_display_brightness_multi()
1741 if (ctx->accum_err) in mipi_dsi_dcs_set_display_brightness_multi()
1744 ret = mipi_dsi_dcs_set_display_brightness(dsi, brightness); in mipi_dsi_dcs_set_display_brightness_multi()
1746 ctx->accum_err = ret; in mipi_dsi_dcs_set_display_brightness_multi()
1748 ctx->accum_err); in mipi_dsi_dcs_set_display_brightness_multi()
1754 * mipi_dsi_dcs_set_pixel_format_multi() - sets the pixel format for the RGB image
1756 * @ctx: Context for multiple DSI transactions
1765 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_pixel_format_multi() local
1766 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_pixel_format_multi()
1769 if (ctx->accum_err) in mipi_dsi_dcs_set_pixel_format_multi()
1772 ret = mipi_dsi_dcs_set_pixel_format(dsi, format); in mipi_dsi_dcs_set_pixel_format_multi()
1774 ctx->accum_err = ret; in mipi_dsi_dcs_set_pixel_format_multi()
1776 ctx->accum_err); in mipi_dsi_dcs_set_pixel_format_multi()
1782 * mipi_dsi_dcs_set_column_address_multi() - define the column extent of the
1784 * @ctx: Context for multiple DSI transactions
1794 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_column_address_multi() local
1795 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_column_address_multi()
1798 if (ctx->accum_err) in mipi_dsi_dcs_set_column_address_multi()
1801 ret = mipi_dsi_dcs_set_column_address(dsi, start, end); in mipi_dsi_dcs_set_column_address_multi()
1803 ctx->accum_err = ret; in mipi_dsi_dcs_set_column_address_multi()
1805 ctx->accum_err); in mipi_dsi_dcs_set_column_address_multi()
1811 * mipi_dsi_dcs_set_page_address_multi() - define the page extent of the
1813 * @ctx: Context for multiple DSI transactions
1823 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_page_address_multi() local
1824 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_page_address_multi()
1827 if (ctx->accum_err) in mipi_dsi_dcs_set_page_address_multi()
1830 ret = mipi_dsi_dcs_set_page_address(dsi, start, end); in mipi_dsi_dcs_set_page_address_multi()
1832 ctx->accum_err = ret; in mipi_dsi_dcs_set_page_address_multi()
1834 ctx->accum_err); in mipi_dsi_dcs_set_page_address_multi()
1840 * mipi_dsi_dcs_set_tear_scanline_multi() - set the scanline to use as trigger for
1842 * @ctx: Context for multiple DSI transactions
1851 struct mipi_dsi_device *dsi = ctx->dsi; in mipi_dsi_dcs_set_tear_scanline_multi() local
1852 struct device *dev = &dsi->dev; in mipi_dsi_dcs_set_tear_scanline_multi()
1855 if (ctx->accum_err) in mipi_dsi_dcs_set_tear_scanline_multi()
1858 ret = mipi_dsi_dcs_set_tear_scanline(dsi, scanline); in mipi_dsi_dcs_set_tear_scanline_multi()
1860 ctx->accum_err = ret; in mipi_dsi_dcs_set_tear_scanline_multi()
1862 ctx->accum_err); in mipi_dsi_dcs_set_tear_scanline_multi()
1869 struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver); in mipi_dsi_drv_probe()
1870 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_drv_probe() local
1872 return drv->probe(dsi); in mipi_dsi_drv_probe()
1877 struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver); in mipi_dsi_drv_remove()
1878 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_drv_remove() local
1880 drv->remove(dsi); in mipi_dsi_drv_remove()
1887 struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver); in mipi_dsi_drv_shutdown()
1888 struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev); in mipi_dsi_drv_shutdown() local
1890 drv->shutdown(dsi); in mipi_dsi_drv_shutdown()
1894 * mipi_dsi_driver_register_full() - register a driver for DSI devices
1895 * @drv: DSI driver structure
1903 drv->driver.bus = &mipi_dsi_bus_type; in mipi_dsi_driver_register_full()
1904 drv->driver.owner = owner; in mipi_dsi_driver_register_full()
1906 if (drv->probe) in mipi_dsi_driver_register_full()
1907 drv->driver.probe = mipi_dsi_drv_probe; in mipi_dsi_driver_register_full()
1908 if (drv->remove) in mipi_dsi_driver_register_full()
1909 drv->driver.remove = mipi_dsi_drv_remove; in mipi_dsi_driver_register_full()
1910 if (drv->shutdown) in mipi_dsi_driver_register_full()
1911 drv->driver.shutdown = mipi_dsi_drv_shutdown; in mipi_dsi_driver_register_full()
1913 return driver_register(&drv->driver); in mipi_dsi_driver_register_full()
1918 * mipi_dsi_driver_unregister() - unregister a driver for DSI devices
1919 * @drv: DSI driver structure
1925 driver_unregister(&drv->driver); in mipi_dsi_driver_unregister()
1936 MODULE_DESCRIPTION("MIPI DSI Bus");