Commit ace98812 authored by David Lechner's avatar David Lechner Committed by Noralf Trønnes

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: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarDavid Lechner <david@lechnology.com>
Reviewed-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1501799630-1650-2-git-send-email-david@lechnology.com
parent 077d92b6
...@@ -195,8 +195,12 @@ static int mi0283qt_probe(struct spi_device *spi) ...@@ -195,8 +195,12 @@ static int mi0283qt_probe(struct spi_device *spi)
device_property_read_u32(dev, "rotation", &rotation); device_property_read_u32(dev, "rotation", &rotation);
ret = mipi_dbi_spi_init(spi, mipi, dc, &mi0283qt_pipe_funcs, ret = mipi_dbi_spi_init(spi, mipi, dc);
&mi0283qt_driver, &mi0283qt_mode, rotation); if (ret)
return ret;
ret = mipi_dbi_init(&spi->dev, mipi, &mi0283qt_pipe_funcs,
&mi0283qt_driver, &mi0283qt_mode, rotation);
if (ret) if (ret)
return ret; return ret;
......
...@@ -776,15 +776,12 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd, ...@@ -776,15 +776,12 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd,
/** /**
* mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller * mipi_dbi_spi_init - Initialize MIPI DBI SPI interfaced controller
* @spi: SPI device * @spi: SPI device
* @dc: D/C gpio (optional)
* @mipi: &mipi_dbi structure to initialize * @mipi: &mipi_dbi structure to initialize
* @pipe_funcs: Display pipe functions * @dc: D/C gpio (optional)
* @driver: DRM driver
* @mode: Display mode
* @rotation: Initial rotation in degrees Counter Clock Wise
* *
* This function sets &mipi_dbi->command, enables &mipi->read_commands for the * This function sets &mipi_dbi->command, enables &mipi->read_commands for the
* usual read commands and initializes @mipi using mipi_dbi_init(). * usual read commands. It should be followed by a call to mipi_dbi_init() or
* a driver-specific init.
* *
* If @dc is set, a Type C Option 3 interface is assumed, if not * If @dc is set, a Type C Option 3 interface is assumed, if not
* Type C Option 1. * Type C Option 1.
...@@ -799,11 +796,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd, ...@@ -799,11 +796,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 cmd,
* Zero on success, negative error code on failure. * Zero on success, negative error code on failure.
*/ */
int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
struct gpio_desc *dc, struct gpio_desc *dc)
const struct drm_simple_display_pipe_funcs *pipe_funcs,
struct drm_driver *driver,
const struct drm_display_mode *mode,
unsigned int rotation)
{ {
size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0); size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0);
struct device *dev = &spi->dev; struct device *dev = &spi->dev;
...@@ -849,7 +842,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, ...@@ -849,7 +842,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
return -ENOMEM; return -ENOMEM;
} }
return mipi_dbi_init(dev, mipi, pipe_funcs, driver, mode, rotation); return 0;
} }
EXPORT_SYMBOL(mipi_dbi_spi_init); EXPORT_SYMBOL(mipi_dbi_spi_init);
......
...@@ -62,11 +62,7 @@ mipi_dbi_from_tinydrm(struct tinydrm_device *tdev) ...@@ -62,11 +62,7 @@ mipi_dbi_from_tinydrm(struct tinydrm_device *tdev)
} }
int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
struct gpio_desc *dc, struct gpio_desc *dc);
const struct drm_simple_display_pipe_funcs *pipe_funcs,
struct drm_driver *driver,
const struct drm_display_mode *mode,
unsigned int rotation);
int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi, int mipi_dbi_init(struct device *dev, struct mipi_dbi *mipi,
const struct drm_simple_display_pipe_funcs *pipe_funcs, const struct drm_simple_display_pipe_funcs *pipe_funcs,
struct drm_driver *driver, struct drm_driver *driver,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment