All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: sam@ravnborg.org, david@lechnology.com
Subject: [PATCH v2 08/11] drm/tinydrm: Move tinydrm_machine_little_endian()
Date: Fri, 19 Jul 2019 17:59:13 +0200	[thread overview]
Message-ID: <20190719155916.62465-9-noralf@tronnes.org> (raw)
In-Reply-To: <20190719155916.62465-1-noralf@tronnes.org>

The tinydrm helper is going away so move it into the only user mipi-dbi.

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/tinydrm/mipi-dbi.c    | 15 ++++++++++++---
 include/drm/tinydrm/tinydrm-helpers.h | 15 ---------------
 2 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index 6a8f2d66377f..73db287e5c52 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -628,6 +628,15 @@ u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len)
 }
 EXPORT_SYMBOL(mipi_dbi_spi_cmd_max_speed);
 
+static bool mipi_dbi_machine_little_endian(void)
+{
+#if defined(__LITTLE_ENDIAN)
+	return true;
+#else
+	return false;
+#endif
+}
+
 /*
  * MIPI DBI Type C Option 1
  *
@@ -650,7 +659,7 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc,
 				   const void *buf, size_t len,
 				   unsigned int bpw)
 {
-	bool swap_bytes = (bpw == 16 && tinydrm_machine_little_endian());
+	bool swap_bytes = (bpw == 16 && mipi_dbi_machine_little_endian());
 	size_t chunk, max_chunk = mipi->tx_buf9_len;
 	struct spi_device *spi = mipi->spi;
 	struct spi_transfer tr = {
@@ -799,7 +808,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *mipi, int dc,
 		size_t chunk = min(len, max_chunk);
 		unsigned int i;
 
-		if (bpw == 16 && tinydrm_machine_little_endian()) {
+		if (bpw == 16 && mipi_dbi_machine_little_endian()) {
 			for (i = 0; i < (chunk * 2); i += 2) {
 				dst16[i]     = *src16 >> 8;
 				dst16[i + 1] = *src16++ & 0xFF;
@@ -991,7 +1000,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
 	if (dc) {
 		mipi->command = mipi_dbi_typec3_command;
 		mipi->dc = dc;
-		if (tinydrm_machine_little_endian() && !spi_is_bpw_supported(spi, 16))
+		if (mipi_dbi_machine_little_endian() && !spi_is_bpw_supported(spi, 16))
 			mipi->swap_bytes = true;
 	} else {
 		mipi->command = mipi_dbi_typec1_command;
diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h
index 8c5d20efeaa1..0e7470771c5e 100644
--- a/include/drm/tinydrm/tinydrm-helpers.h
+++ b/include/drm/tinydrm/tinydrm-helpers.h
@@ -15,21 +15,6 @@ struct drm_simple_display_pipe;
 struct drm_simple_display_pipe_funcs;
 struct device;
 
-/**
- * tinydrm_machine_little_endian - Machine is little endian
- *
- * Returns:
- * true if *defined(__LITTLE_ENDIAN)*, false otherwise
- */
-static inline bool tinydrm_machine_little_endian(void)
-{
-#if defined(__LITTLE_ENDIAN)
-	return true;
-#else
-	return false;
-#endif
-}
-
 int tinydrm_display_pipe_init(struct drm_device *drm,
 			      struct drm_simple_display_pipe *pipe,
 			      const struct drm_simple_display_pipe_funcs *funcs,
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-07-19 15:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 15:59 [PATCH v2 00/11] drm/tinydrm: Remove tinydrm.ko Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 01/11] drm: Add SPI connector type Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 02/11] drm/tinydrm: Use DRM_MODE_CONNECTOR_SPI Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 03/11] drm/tinydrm: Use spi_is_bpw_supported() Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 04/11] drm/tinydrm: Remove spi debug buffer dumping Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 05/11] drm/tinydrm: Remove tinydrm_spi_max_transfer_size() Noralf Trønnes
2019-10-15 14:32   ` Andy Shevchenko
2019-10-15 15:02     ` Andy Shevchenko
2019-10-15 15:41     ` Noralf Trønnes
2019-10-15 15:57       ` Daniel Vetter
2019-10-16 16:13         ` Andy Shevchenko
2019-10-16 17:44           ` Daniel Vetter
2019-10-16 18:00             ` Mark Brown
2019-10-17  6:58             ` Andy Shevchenko
2019-10-15 15:59       ` Andy Shevchenko
2019-10-15 16:05         ` Daniel Vetter
2019-10-16  8:07           ` Andy Shevchenko
2019-10-15 16:55         ` Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 06/11] drm/tinydrm: Clean up tinydrm_spi_transfer() Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 07/11] drm/tinydrm: Move tinydrm_spi_transfer() Noralf Trønnes
2019-07-19 15:59 ` Noralf Trønnes [this message]
2019-07-19 15:59 ` [PATCH v2 09/11] drm/tinydrm/repaper: Don't use tinydrm_display_pipe_init() Noralf Trønnes
2019-07-19 15:59 ` [PATCH v2 10/11] drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats() Noralf Trønnes
2019-07-22 19:48   ` David Lechner
2019-07-19 15:59 ` [PATCH v2 11/11] drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi Noralf Trønnes
2019-07-23 14:11 ` [PATCH v2 00/11] drm/tinydrm: Remove tinydrm.ko Noralf Trønnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190719155916.62465-9-noralf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.