diff options
| author | David Lechner <david@lechnology.com> | 2017-08-03 18:33:45 -0400 |
|---|---|---|
| committer | Noralf Trønnes <noralf@tronnes.org> | 2017-08-04 09:12:25 -0400 |
| commit | ace988123c3b5cff5f64dabb7b4decf8212242a4 (patch) | |
| tree | ceb9ef98d7b80052dfec8bf397aba3fff2d1fec3 /drivers/gpu/drm/tinydrm | |
| parent | 077d92b6fd9fd5142e5da91c3f8ce3a6064f29a4 (diff) | |
drm/tinydrm: remove call to mipi_dbi_init() from mipi_dbi_spi_init()
This removes the call to mipi_dbi_init() from mipi_dbi_spi_init() so that
drivers can have a driver-specific implementation if needed.
Suggested-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: David Lechner <david@lechnology.com>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1501799630-1650-2-git-send-email-david@lechnology.com
Diffstat (limited to 'drivers/gpu/drm/tinydrm')
| -rw-r--r-- | drivers/gpu/drm/tinydrm/mi0283qt.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/tinydrm/mipi-dbi.c | 17 |
2 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/tinydrm/mi0283qt.c b/drivers/gpu/drm/tinydrm/mi0283qt.c index 482ff1c3db61..7e5bb7d6f655 100644 --- a/drivers/gpu/drm/tinydrm/mi0283qt.c +++ b/drivers/gpu/drm/tinydrm/mi0283qt.c | |||
| @@ -195,8 +195,12 @@ static int mi0283qt_probe(struct spi_device *spi) | |||
| 195 | 195 | ||
| 196 | device_property_read_u32(dev, "rotation", &rotation); | 196 | device_property_read_u32(dev, "rotation", &rotation); |
| 197 | 197 | ||
| 198 | ret = mipi_dbi_spi_init(spi, mipi, dc, &mi0283qt_pipe_funcs, | 198 | ret = mipi_dbi_spi_init(spi, mipi, dc); |
| 199 | &mi0283qt_driver, &mi0283qt_mode, rotation); | 199 | if (ret) |
| 200 | return ret; | ||
| 201 | |||
| 202 | ret = mipi_dbi_init(&spi->dev, mipi, &mi0283qt_pipe_funcs, | ||
| 203 | &mi0283qt_driver, &mi0283qt_mode, rotation); | ||
| 200 | if (ret) | 204 | if (ret) |
| 201 | return ret; | 205 | return ret; |
| 202 | 206 | ||
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index c83eeb7a34b0..2caeabcd3458 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c | |||
| @@ -776,15 +776,12 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd, | |||
| 776 | /** | 776 | /** |
| 777 | * mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller | 777 | * mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller |
| 778 | * @spi: SPI device | 778 | * @spi: SPI device |
| 779 | * @dc: D/C gpio (optional) | ||
| 780 | * @mipi: &mipi_dbi structure to initialize | 779 | * @mipi: &mipi_dbi structure to initialize |
| 781 | * @pipe_funcs: Display pipe functions | 780 | * @dc: D/C gpio (optional) |
| 782 | * @driver: DRM driver | ||
| 783 | * @mode: Display mode | ||
| 784 | * @rotation: Initial rotation in degrees Counter Clock Wise | ||
| 785 | * | 781 | * |
| 786 | * This function sets &mipi_dbi->command, enables &mipi->read_commands for the | 782 | * This function sets &mipi_dbi->command, enables &mipi->read_commands for the |
| 787 | * usual read commands and initializes @mipi using mipi_dbi_init(). | 783 | * usual read commands. It should be followed by a call to mipi_dbi_init() or |
| 784 | * a driver-specific init. | ||
| 788 | * | 785 | * |
| 789 | * If @dc is set, a Type C Option 3 interface is assumed, if not | 786 | * If @dc is set, a Type C Option 3 interface is assumed, if not |
| 790 | * Type C Option 1. | 787 | * Type C Option 1. |
| @@ -799,11 +796,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd, | |||
| 799 | * Zero on success, negative error code on failure. | 796 | * Zero on success, negative error code on failure. |
| 800 | */ | 797 | */ |
| 801 | int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, | 798 | int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, |
| 802 | struct gpio_desc *dc, | 799 | struct gpio_desc *dc) |
| 803 | const struct drm_simple_display_pipe_funcs *pipe_funcs, | ||
| 804 | struct drm_driver *driver, | ||
| 805 | const struct drm_display_mode *mode, | ||
| 806 | unsigned int rotation) | ||
| 807 | { | 800 | { |
| 808 | size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0); | 801 | size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0); |
| 809 | struct device *dev = &spi->dev; | 802 | struct device *dev = &spi->dev; |
| @@ -849,7 +842,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, | |||
| 849 | return -ENOMEM; | 842 | return -ENOMEM; |
| 850 | } | 843 | } |
| 851 | 844 | ||
| 852 | return mipi_dbi_init(dev, mipi, pipe_funcs, driver, mode, rotation); | 845 | return 0; |
| 853 | } | 846 | } |
| 854 | EXPORT_SYMBOL(mipi_dbi_spi_init); | 847 | EXPORT_SYMBOL(mipi_dbi_spi_init); |
| 855 | 848 | ||
