Skip to content

Commit e9f6806

Browse files
menschel-dgregkh
authored andcommitted
staging: fbtft: add support for C-Berry28 display
This patch adds support for the C-Berry28, a small 2.8" color display with a resolution of 320x240 pixels from admatec for the Raspberry Pi. It uses the Sitronix ST7789V display controller along with a custom init sequence and custom gamma curves. Signed-off-by: Dennis Menschel <menschel-d@posteo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d4c402f commit e9f6806

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

‎drivers/staging/fbtft/fbtft_device.c‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,59 @@ static void adafruit18_green_tab_set_addr_win(struct fbtft_par *par,
126126
"02 1c 07 12 37 32 29 2d 29 25 2B 39 00 01 03 10\n" \
127127
"03 1d 07 06 2E 2C 29 2D 2E 2E 37 3F 00 00 02 10"
128128

129+
#define CBERRY28_GAMMA \
130+
"D0 00 14 15 13 2C 42 43 4E 09 16 14 18 21\n" \
131+
"D0 00 14 15 13 0B 43 55 53 0C 17 14 23 20"
132+
133+
static int cberry28_init_sequence[] = {
134+
/* turn off sleep mode */
135+
-1, 0x11,
136+
-2, 120,
137+
138+
/* set pixel format to RGB-565 */
139+
-1, 0x3A, 0x05,
140+
141+
-1, 0xB2, 0x0C, 0x0C, 0x00, 0x33, 0x33,
142+
143+
/*
144+
* VGH = 13.26V
145+
* VGL = -10.43V
146+
*/
147+
-1, 0xB7, 0x35,
148+
149+
/*
150+
* VDV and VRH register values come from command write
151+
* (instead of NVM)
152+
*/
153+
-1, 0xC2, 0x01, 0xFF,
154+
155+
/*
156+
* VAP = 4.7V + (VCOM + VCOM offset + 0.5 * VDV)
157+
* VAN = -4.7V + (VCOM + VCOM offset + 0.5 * VDV)
158+
*/
159+
-1, 0xC3, 0x17,
160+
161+
/* VDV = 0V */
162+
-1, 0xC4, 0x20,
163+
164+
/* VCOM = 0.875V */
165+
-1, 0xBB, 0x1F,
166+
167+
/* VCOM offset = 0V */
168+
-1, 0xC5, 0x20,
169+
170+
/*
171+
* AVDD = 6.6V
172+
* AVCL = -4.8V
173+
* VDS = 2.3V
174+
*/
175+
-1, 0xD0, 0xA4, 0x61,
176+
177+
-1, 0x29,
178+
179+
-3,
180+
};
181+
129182
static int hy28b_init_sequence[] = {
130183
-1, 0x00e7, 0x0010, -1, 0x0000, 0x0001,
131184
-1, 0x0001, 0x0100, -1, 0x0002, 0x0700,
@@ -312,6 +365,27 @@ static struct fbtft_device_display displays[] = {
312365
},
313366
}
314367
}
368+
}, {
369+
.name = "admatec_c-berry28",
370+
.spi = &(struct spi_board_info) {
371+
.modalias = "fb_st7789v",
372+
.max_speed_hz = 48000000,
373+
.mode = SPI_MODE_0,
374+
.platform_data = &(struct fbtft_platform_data) {
375+
.display = {
376+
.buswidth = 8,
377+
.backlight = 1,
378+
.init_sequence = cberry28_init_sequence,
379+
},
380+
.gpios = (const struct fbtft_gpio []) {
381+
{ "reset", 25 },
382+
{ "dc", 22 },
383+
{ "led", 18 },
384+
{},
385+
},
386+
.gamma = CBERRY28_GAMMA,
387+
}
388+
}
315389
}, {
316390
.name = "agm1264k-fl",
317391
.pdev = &(struct platform_device) {

0 commit comments

Comments
 (0)