]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: fbtft: Remove duplications of fbtft_set_addr_win()
authorNam Cao <namcao@linutronix.de>
Fri, 13 Feb 2026 08:59:27 +0000 (09:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 14:42:45 +0000 (15:42 +0100)
Lots of drivers duplicate the default fbtft_set_addr_win(). Just use the
default instead.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260213085927.3673653-1-namcao@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fb_hx8340bn.c
drivers/staging/fbtft/fb_hx8353d.c
drivers/staging/fbtft/fb_hx8357d.c
drivers/staging/fbtft/fb_ili9340.c
drivers/staging/fbtft/fb_ili9341.c
drivers/staging/fbtft/fb_ili9481.c
drivers/staging/fbtft/fb_ili9486.c
drivers/staging/fbtft/fb_s6d02a1.c
drivers/staging/fbtft/fb_st7735r.c
drivers/staging/fbtft/fb_tinylcd.c

index 2fd7b87ea0cefa76ced8368627bc4b1aac996eb6..ca27914f14122abae552dbce4b02d4c8a283604c 100644 (file)
@@ -106,13 +106,6 @@ static int init_display(struct fbtft_par *par)
        return 0;
 }
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS, 0x00, xs, 0x00, xe);
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS, 0x00, ys, 0x00, ye);
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 static int set_var(struct fbtft_par *par)
 {
        /* MADCTL - Memory data access control */
@@ -207,7 +200,6 @@ static struct fbtft_display display = {
        .gamma = DEFAULT_GAMMA,
        .fbtftops = {
                .init_display = init_display,
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
                .set_gamma = set_gamma,
        },
index 3e73b69b6a27627833e9f19d83b63c32bb1ac4b7..f6cd82df4da603b7a53420d618ad226b5be90c66 100644 (file)
@@ -61,18 +61,6 @@ static int init_display(struct fbtft_par *par)
        return 0;
 };
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       /* column address */
-       write_reg(par, 0x2a, xs >> 8, xs & 0xff, xe >> 8, xe & 0xff);
-
-       /* Row address */
-       write_reg(par, 0x2b, ys >> 8, ys & 0xff, ye >> 8, ye & 0xff);
-
-       /* memory write */
-       write_reg(par, 0x2c);
-}
-
 #define my BIT(7)
 #define mx BIT(6)
 #define mv BIT(5)
@@ -130,7 +118,6 @@ static struct fbtft_display display = {
        .gamma = DEFAULT_GAMMA,
        .fbtftops = {
                .init_display = init_display,
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
                .set_gamma = set_gamma,
        },
index 94a357e8fdf6a60903ea9f5a0cc597b1eb10e773..7b9f020a956f4ba6da897cba4cf632b9a6f8d455 100644 (file)
@@ -129,19 +129,6 @@ static int init_display(struct fbtft_par *par)
        return 0;
 }
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xff,  /* XSTART */
-                 xe >> 8, xe & 0xff); /* XEND */
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xff,  /* YSTART */
-                 ye >> 8, ye & 0xff); /* YEND */
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 #define HX8357D_MADCTL_MY  0x80
 #define HX8357D_MADCTL_MX  0x40
 #define HX8357D_MADCTL_MV  0x20
@@ -184,7 +171,6 @@ static struct fbtft_display display = {
        .gamma_len = 14,
        .fbtftops = {
                .init_display = init_display,
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
        },
 };
index 704236bcaf3fff2e8bd9ed514675892a54e8cbb2..023d8cb96f955cc01dcc1295f7927e66be889703 100644 (file)
@@ -78,17 +78,6 @@ static int init_display(struct fbtft_par *par)
        return 0;
 }
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xFF, xe >> 8, xe & 0xFF);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 #define ILI9340_MADCTL_MV  0x20
 #define ILI9340_MADCTL_MX  0x40
 #define ILI9340_MADCTL_MY  0x80
@@ -122,7 +111,6 @@ static struct fbtft_display display = {
        .height = HEIGHT,
        .fbtftops = {
                .init_display = init_display,
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
        },
 };
index 47e72b87d76d996111aaadcf5e56dfdfc1c331ab..428922dee9f904dbe1e84ed983d3cc7f19f1641c 100644 (file)
@@ -65,17 +65,6 @@ static int init_display(struct fbtft_par *par)
        return 0;
 }
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 #define MEM_Y   BIT(7) /* MY row address order */
 #define MEM_X   BIT(6) /* MX column address order */
 #define MEM_V   BIT(5) /* MV row / column exchange */
@@ -139,7 +128,6 @@ static struct fbtft_display display = {
        .gamma = DEFAULT_GAMMA,
        .fbtftops = {
                .init_display = init_display,
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
                .set_gamma = set_gamma,
        },
index 19eba085ea53ee2e132c9572c148b8fac8d15352..5f31b5d5590f0943f4bddf751943a2841fcd0457 100644 (file)
@@ -42,17 +42,6 @@ static const s16 default_init_sequence[] = {
        -3
 };
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xff, xe >> 8, xe & 0xff);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xff, ye >> 8, ye & 0xff);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 #define HFLIP 0x01
 #define VFLIP 0x02
 #define ROW_X_COL 0x20
@@ -86,7 +75,6 @@ static struct fbtft_display display = {
        .height = HEIGHT,
        .init_sequence = default_init_sequence,
        .fbtftops = {
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
        },
 };
index 66210a7137fccc8778409181887e8a41b8ad8882..a4d699ef57e4d4beda50d2796eacf2ab69cd0be2 100644 (file)
@@ -43,17 +43,6 @@ static const s16 default_init_sequence[] = {
        -3
 };
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xFF, xe >> 8, xe & 0xFF);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 static int set_var(struct fbtft_par *par)
 {
        switch (par->info->var.rotate) {
@@ -86,7 +75,6 @@ static struct fbtft_display display = {
        .height = HEIGHT,
        .init_sequence = default_init_sequence,
        .fbtftops = {
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
        },
 };
index d3d6871d8c47fae65153a91308cfe7fa275c5de7..d8ddc804d626ef658ec9508ee48f9f414bf588c1 100644 (file)
@@ -97,17 +97,6 @@ static const s16 default_init_sequence[] = {
 
 };
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xFF, xe >> 8, xe & 0xFF);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 #define MY BIT(7)
 #define MX BIT(6)
 #define MV BIT(5)
@@ -149,7 +138,6 @@ static struct fbtft_display display = {
        .height = 160,
        .init_sequence = default_init_sequence,
        .fbtftops = {
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
        },
 };
index 9670a8989b9175d6377a753716dff514b8b4fbca..6d9735fa233244e5398aae0083224422bbcd9b47 100644 (file)
@@ -83,17 +83,6 @@ static const s16 default_init_sequence[] = {
        -3
 };
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xFF, xe >> 8, xe & 0xFF);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 #define MY BIT(7)
 #define MX BIT(6)
 #define MV BIT(5)
@@ -168,7 +157,6 @@ static struct fbtft_display display = {
        .gamma_len = 16,
        .gamma = DEFAULT_GAMMA,
        .fbtftops = {
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
                .set_gamma = set_gamma,
        },
index 9469248f2c507898047ad9d4bb61572feb82e4e9..fc17e3c687fbbb3ca747e08b43e425d7521ff1db 100644 (file)
@@ -47,17 +47,6 @@ static int init_display(struct fbtft_par *par)
        return 0;
 }
 
-static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
-{
-       write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
-                 xs >> 8, xs & 0xFF, xe >> 8, xe & 0xFF);
-
-       write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
-                 ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
-
-       write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
-}
-
 static int set_var(struct fbtft_par *par)
 {
        switch (par->info->var.rotate) {
@@ -88,7 +77,6 @@ static struct fbtft_display display = {
        .height = HEIGHT,
        .fbtftops = {
                .init_display = init_display,
-               .set_addr_win = set_addr_win,
                .set_var = set_var,
        },
 };