nobby-230: update device- and linux- packages (MR 1165)

Changes:
- Add audio package dependency;
- Replace panel driver with one from stock kernel (thanks to bnister);
- Change keyboard layout so it's fully supported in X11.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
HenriDellal 2020-04-19 14:27:02 +03:00 committed by Oliver Smith
parent a134f3fc22
commit 467ed09ec3
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 15 additions and 517 deletions

View file

@ -1,20 +1,18 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Anri Dellal <anridellal@gmail.com>
# Contributor: Anri Dellal <anridellal@gmail.com>
pkgname="device-nobby-230"
pkgname=device-nobby-230
pkgdesc="Nobby 230"
pkgver=0.1
pkgrel=2
pkgver=0.2
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="msm-fb-refresher postmarketos-base linux-nobby-230 mkbootimg mesa-dri-swrast"
depends="soc-sprd-audio-sc8830 msm-fb-refresher postmarketos-base linux-nobby-230 mkbootimg mesa-dri-swrast"
makedepends="devicepkg-dev"
source="
deviceinfo
asound.conf
initfs-hook.sh
"
build() {
@ -23,12 +21,7 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -D -m644 "$srcdir"/asound.conf \
"$pkgdir"/etc/asound.conf
}
sha512sums="e6439c78f162a94f13be2a7e0e5f23fcb663fb4590280e138b5d3da01d461616303863bd752b2ba656b5b2454146b66d27c415488d4016d4cfbd537b747b798f deviceinfo
369df19f9bf7546236b81a33c00b6384e88e979c4711fead3749f8e60f4cd99f37b31baf1f00d05a821cb71ca2f440648e13083653f1a4ec0c178c7c1c415a58 asound.conf
b2838f65401d506a8c64a022a12887e67c410f3e21279e1c6ec2b88c3b51a0ce4f31b9de6883c3ff786cbb000a7fe8a39342fe313a6425bd6f281e521c143492 initfs-hook.sh"
sha512sums="e6439c78f162a94f13be2a7e0e5f23fcb663fb4590280e138b5d3da01d461616303863bd752b2ba656b5b2454146b66d27c415488d4016d4cfbd537b747b798f deviceinfo"

View file

@ -1,9 +0,0 @@
pcm.!default {
type hw
card sprdphone
}
ctl.!default {
type hw
card sprdphone
}

View file

@ -1,7 +0,0 @@
#!/bin/sh
# set framebuffer resolution
echo 1 > /sys/class/graphics/fb0/state
echo 240,640 > /sys/class/graphics/fb0/virtual_size
echo 0,320 > /sys/class/graphics/fb0/pan

View file

@ -27,485 +27,3 @@ index ac5d5c4..ada4ee0 100644
obj-$(CONFIG_FB_LCD_ST7789V_MCU) += lcd_st7789v_mcu.o
obj-$(CONFIG_FB_LCD_NT35502_MIPI) += lcd_nt35502_mipi.o
obj-$(CONFIG_FB_LCD_NT35502_MIPI) += lcd_nt35502_mipi.o
diff --git a/drivers/video/sprdfb/lcd/lcd_ili9340.c b/drivers/video/sprdfb/lcd/lcd_ili9340.c
new file mode 100644
index 0000000..47a63ec
--- /dev/null
+++ b/drivers/video/sprdfb/lcd/lcd_ili9340.c
@@ -0,0 +1,476 @@
+/* drivers/video/sc8810/lcd_ili9340.c
+ *
+ * Support for ili9340 LCD device
+ *
+ * Copyright (C) 2010 Spreadtrum
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include "../sprdfb_panel.h"
+
+static int32_t ili9340_init(struct panel_spec *self)
+{
+ send_data_t send_cmd = self->info.mcu->ops->send_cmd;
+ send_data_t send_data = self->info.mcu->ops->send_data;
+
+ pr_debug("ili9340_init\n");
+
+ //NEW
+ send_cmd(0xEF);
+ send_data(0x03);
+ send_data(0x80);
+ send_data(0x02);
+
+ //Power Setting
+ send_cmd(0xCF);
+ send_data(0x00);//NOP
+ send_data(0xC1);
+// send_data(0xE1);//Neg. gamma correction
+ send_data(0x30);//Partial area
+
+ send_cmd(0xED);//
+ send_data(0x64);//
+ send_data(0x03);
+ send_data(0x12);
+ send_data(0x81);
+
+ //NEW
+ send_cmd(0xE8);
+ send_data(0x85);
+ send_data(0x00);
+ send_data(0x78);
+
+ send_cmd(0xCB);
+ send_data(0x39);
+ send_data(0x2C);
+ send_data(0x00);
+ send_data(0x34);
+ send_data(0x02);
+
+ send_cmd(0xF7);
+ send_data(0x20);
+
+ send_cmd(0xEA);
+ send_data(0x00);
+ send_data(0x00);
+
+ //NEW
+ send_cmd(0xC0);
+ send_data(0x23);
+
+ //NEW
+ send_cmd(0xC1);
+ send_data(0x10);
+
+ send_cmd(0xC5);
+ send_data(0x3e);
+ send_data(0x28);
+ //send_data(0x4C);
+ //send_data(0x2B);
+
+ send_cmd(0xC7);
+ send_data(0x86);
+
+ send_cmd(0x3A);
+ send_data(0x55);
+
+ send_cmd(0xB1);
+ send_data(0x00);
+ send_data(0x18);
+
+ send_cmd(0xB6);
+ send_data(0x08);
+ send_data(0x82);
+ send_data(0x27);
+
+ send_cmd(0x36);
+ send_data(0x08);
+
+ send_cmd(0xF2);
+ send_data(0x00);
+
+ send_cmd(0x26);
+ send_data(0x01);
+ //send_data(0x00);
+
+ /*send_cmd(0xC0);
+ send_data(0x22);
+
+ send_cmd(0xC1);
+ send_data(0x11);
+
+ //Initializing Sequence
+ send_cmd(0x35);
+ send_data(0x00);
+
+ send_cmd(0x3A);
+ send_data(0x05);
+
+ send_cmd(0xF2);
+ send_data(0x02);
+
+ send_cmd(0xB6);
+ send_data(0x01);
+ send_data(0xC2);
+
+ send_cmd(0xF6);
+ send_data(0x01);
+ send_data(0x10);
+ send_data(0x00);
+
+ send_cmd(0xB1);
+ send_data(0x00);
+ send_data(0x1A);
+
+ send_cmd(0xB5);
+ send_data(0x02);
+ send_data(0x02);
+ send_data(0x0A);
+ send_data(0x14);
+
+ send_cmd(0xE8);
+ send_data(0x85);
+ send_data(0x01);
+ send_data(0x78);
+*/
+
+ //Gamma Setting
+ send_cmd(0xE0);
+ send_data(0x0F);
+ send_data(0x31);
+ //send_data(0x2F);
+ send_data(0x2B);
+ //send_data(0x0D);
+ send_data(0x0C);
+ //send_data(0x10);
+ send_data(0x0E);
+ send_data(0x08);
+ send_data(0x4E);
+ send_data(0xF1);
+ send_data(0x37);
+ send_data(0x07);
+ send_data(0x10);
+ send_data(0x03);
+ send_data(0x0E);
+ send_data(0x09);
+ send_data(0x00);
+
+ send_cmd(0xE1);
+ send_data(0x00);
+ send_data(0x0E);
+ send_data(0x14);
+ send_data(0x03);
+ send_data(0x11);
+ send_data(0x07);
+ send_data(0x31);
+ send_data(0xC1);
+ send_data(0x48);
+ send_data(0x08);
+ send_data(0x0F);
+ send_data(0x0C);
+ send_data(0x31);
+ send_data(0x36);
+ send_data(0x0F);
+
+/*
+ send_cmd(0xE2);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+
+ send_cmd(0xE3);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x00);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x22);
+ send_data(0x22);
+ send_data(0x22);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x33);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x03);
+ send_data(0x02);
+ send_data(0x01);
+ send_data(0x00);
+*/
+#if 1
+ //Display on
+ send_cmd(0x11); // (SLPOUT)
+ mdelay(12); // 100ms
+ send_cmd(0x29); // (DISPON)
+ mdelay(10); // 100ms
+ pr_debug("ili9340_init: end\n");
+
+ return 0;
+#else
+ if (1) { // for test the lcd
+ int i;
+ send_cmd(0x2C); //Write data
+ for (i = 0; i < 240*320/3; i++)
+ send_data(0xff);
+ for (i = 0; i < 240*320/3; i++)
+ send_data(0xff00);
+ for (i = 0; i < 24*320/3; i++)
+ send_data(0xff0000);
+ }
+ send_cmd(0x11); //Display On
+ mdelay(10); //120ms
+ send_cmd(0x29); //Write data
+ mdelay(10); //120ms
+#endif
+ pr_debug("ili9340_init: end\n");
+
+ return 0;
+}
+
+static int32_t ili9340_set_window(struct panel_spec *self,
+ uint16_t left, uint16_t top, uint16_t right, uint16_t bottom)
+{
+ send_data_t send_cmd = self->info.mcu->ops->send_cmd;
+ send_data_t send_data = self->info.mcu->ops->send_data;
+
+ pr_debug("ili9340_set_window\n");
+
+ send_cmd(0x2A); // col
+ send_data((left >> 8));
+ send_data((left & 0xFF));
+ send_data((right >> 8));
+ send_data((right & 0xFF));
+
+ send_cmd(0x2B); // row
+ send_data((top >> 8));
+ send_data((top & 0xFF));
+ send_data((bottom >> 8));
+ send_data((bottom & 0xFF));
+
+ send_cmd(0x2C);
+
+ return 0;
+}
+
+
+static int32_t ili9340_invalidate(struct panel_spec *self)
+{
+ pr_debug("ili9340_invalidate\n");
+
+ return self->ops->panel_set_window(self, 0, 0,
+ self->width-1, self->height-1);
+}
+
+static int32_t ili9340_invalidate_rect(struct panel_spec *self,
+ uint16_t left, uint16_t top,
+ uint16_t right, uint16_t bottom)
+{
+
+ pr_debug("ili9340_invalidate_rect : (%d, %d, %d, %d)\n",left, top, right, bottom);
+
+ return self->ops->panel_set_window(self, left, top,
+ right, bottom);
+}
+
+static int32_t ili9340_set_direction(struct panel_spec *self, uint16_t direction)
+{
+
+ pr_debug("ili9340_set_direction\n");
+ return 0;
+}
+
+static int32_t ili9340_enter_sleep(struct panel_spec *self, uint8_t is_sleep)
+{
+ //send_data_t send_cmd = self->info.mcu->ops->send_cmd;
+
+ if(is_sleep) {
+ //send_cmd(0x10);
+ mdelay(120);
+ }
+ else {
+ //send_cmd(0x11);
+ mdelay(120);
+ }
+ return 0;
+}
+
+static uint32_t ili9340_read_id(struct panel_spec *self)
+{
+ int32_t read_value = 0;
+#if 0
+ send_data_t send_cmd = self->info.mcu->ops->send_cmd;
+ read_data_t read_data = self->info.mcu->ops->read_data;
+
+ send_cmd(0x04);
+
+ read_data();
+ read_value += read_data()<< 16;
+ read_value += read_data()<< 8;
+ read_value += read_data();
+#endif
+ pr_debug("ili9340_read_id=%x\n",read_value);
+
+ read_value = 0x9340;
+
+ return read_value;
+}
+
+static int32_t ili9340_change_epf(struct panel_spec *self, bool is_default)
+{
+ send_data_t send_cmd = self->info.mcu->ops->send_cmd;
+ send_data_t send_data = self->info.mcu->ops->send_data;
+
+ return 0;
+
+ if(is_default){
+ send_cmd(0xF6);
+ send_data(0x01);
+ send_data(0x30);
+ send_data(0x00);
+ }else{
+ send_cmd(0xF6);
+ send_data(0x01);
+ send_data(0x10);
+ send_data(0x00);
+ }
+
+ return 0;
+}
+
+static struct panel_operations lcd_ili9340_operations = {
+ .panel_init = ili9340_init,
+ .panel_set_window = ili9340_set_window,
+ .panel_invalidate = ili9340_invalidate,
+ //.lcd_invalidate_rect = ili9340_invalidate_rect,
+ .panel_set_direction = ili9340_set_direction,
+ .panel_enter_sleep = ili9340_enter_sleep,
+ .panel_readid = ili9340_read_id,
+ .panel_change_epf = ili9340_change_epf,
+};
+
+static struct timing_mcu lcd_ili9340_timing[] = {
+ [MCU_LCD_REGISTER_TIMING] = {
+ .rcss = 25,
+ .rlpw = 45,
+ .rhpw = 90,
+ .wcss = 30,
+ .wlpw = 20,
+ .whpw = 20,
+ },
+ [MCU_LCD_GRAM_TIMING] = {
+ .rcss = 25,
+ .rlpw = 45,
+ .rhpw = 90,
+ .wcss = 30,
+ .wlpw = 20,
+ .whpw = 20,
+ }
+};
+
+static struct info_mcu lcd_ili9340_info = {
+ .bus_mode = LCD_BUS_8080,
+ .bus_width = 16,
+ .bpp = 16, /*RGB88*/
+ .timing = &lcd_ili9340_timing,
+ .ops = NULL,
+};
+
+struct panel_spec lcd_panel_ili9340 = {
+ .width = 240,
+ .height = 320,
+ .fps = 60,
+ .type = LCD_MODE_MCU,
+ .direction = LCD_DIRECT_NORMAL,
+ .info = {
+ .mcu = &lcd_ili9340_info
+ },
+ .ops = &lcd_ili9340_operations,
+};
+
+struct panel_cfg lcd_ili9340 = {
+ /* this panel may on both CS0/1 */
+ .dev_id = SPRDFB_MAINLCD_ID,
+ .lcd_id = 0x9340,
+ .lcd_name = "lcd_ili9340",
+ .panel = &lcd_panel_ili9340,
+};
+
+static int __init lcd_ili9340_init(void)
+{
+ printk(KERN_INFO "sprdfb_111: [%s]: 0x%x!\n", __FUNCTION__,lcd_ili9340.lcd_id);
+
+ return sprdfb_panel_register(&lcd_ili9340);
+}
+
+subsys_initcall(lcd_ili9340_init);
+

View file

@ -65,7 +65,7 @@ index d80e056..cc9db11 100755
+ KEY(1, 1, KEY_0),
+ KEY(0, 2, KEY_3),
+ KEY(1, 2, KEY_MENU),
+ KEY(2, 2, KEY_NUMERIC_POUND),
+ KEY(2, 2, KEY_SLASH),
};
static const struct matrix_keymap_data customize_keymap = {
@ -178,7 +178,7 @@ index d80e056..cc9db11 100755
+ {
+ .gpio = GPIO_SELECT_KEY,
+ .ds_irqflags = IRQF_TRIGGER_LOW,
+ .code = KEY_SELECT,
+ .code = KEY_ENTER,
+ .desc = "Select key",
+ .active_low = 1,
+ .debounce_interval = 2,
@ -186,7 +186,7 @@ index d80e056..cc9db11 100755
+ {
+ .gpio = GPIO_NUMERIC_STAR_KEY,
+ .ds_irqflags = IRQF_TRIGGER_LOW,
+ .code = KEY_NUMERIC_STAR,
+ .code = KEY_KPASTERISK,
+ .desc = "Star key",
+ .active_low = 1,
+ .debounce_interval = 2,

View file

@ -3,9 +3,9 @@
# Contributor: Anri Dellal <anridellal@gmail.com>
# Kernel config based on: arch/arm/configs/sp7715ga-native_defconfig
pkgname="linux-nobby-230"
pkgname=linux-nobby-230
pkgver=3.10.17
pkgrel=0
pkgrel=1
pkgdesc="Nobby 230 kernel fork"
arch="armv7"
_carch="arm"
@ -29,6 +29,7 @@ _config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/Qiangong2/$_repository/archive/$_commit.tar.gz
$_config
lcd_ili9340.c::https://raw.githubusercontent.com/HenriDellal/generic-kernels-code/6fb20b61d99c554fed45397b8f05698ee93ddd85/drivers/video/sprdfb/lcd/lcd_nv3029g-01-as-ili9340.c
kernel-use-the-gnu89-standard-explicitly.patch
01-fix-X11.patch
02-arm-eabi-not-found.patch
@ -42,6 +43,7 @@ builddir="$srcdir/$_repository-$_commit"
prepare() {
default_prepare
. downstreamkernel_prepare
cp "$srcdir"/lcd_ili9340.c "$builddir"/drivers/video/sprdfb/lcd/
}
build() {
@ -56,10 +58,11 @@ package() {
sha512sums="0bee0e9c67c155957ed90f6f3707ec9663fd541c1c73e93c747b71423b37d64486c1c758b5e889280210b69d377c0bb203346f8d290252d5a4989788749b6e89 linux-nobby-230-161c7229a4873ead08fc0118d93967b66e38d645.tar.gz
d24744af22416041aad23e67af3b37223e8a3ea8c6e2966431c8519886c2c0520f7c80939fdbe87225172f33f53e31a6501caac7c847c34b72f54b3c801cce1c config-nobby-230.armv7
35f8b9f5a22c8aec5906b1ba2fc4c214962d8091e933abe7b354b0e9023b03bb543a08157e0d22c68367ef30b3543af9385299fdcfa8df63cca9da08a8fa4d80 lcd_ili9340.c
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
fd3d5578120f43a09013feebe3ea75cff71de1078a92a20d27083f15279106f4c95f7889d432eabc689954d9db4bff09a429374b8d2891f23f08d64e66affd86 01-fix-X11.patch
1cc15cf60c31f9cf4d82c74c3578fd8be55506278e5106634973784179509e47a7741e42241a7aa8622c0ce4192a331cf860b11537998ba4f8af4da13718229e 02-arm-eabi-not-found.patch
720babeda78dfda03e99771bcdbaea35a9dc5fbe4ad6d6464802fda66829cb4b74a275d0f209e7f093c98a3b5ab654edeebfbdc499398ca8b21046534f7acd0b 03-add-ili9340-support.patch
3b05155fdde4eca90c3c3be672f4e6eb2d888110eceb6ca88b593f835be36bcab91206dced76bc0a3ca71346ce50b4adec10a9f47a00a69b1d6e11ac268a51a9 04-add-keypad-support.patch
9897f8c0f1846bca8be3c7a928c908df69f03c3a833e24c0f0b7aff75fc66b8cbae9b3022acb6182f89e9a1297e5f04d1cf4f03b4f570c808e6cdcac747c4aec 03-add-ili9340-support.patch
7207dfbdf34b658045b7c1d35b65223a88bd469dcd9c98265b62884b336ff5c28f893e259b4655ae2c3e0a1ec3d6db5e018a178c2628641f95bf1282841bbe3d 04-add-keypad-support.patch
8eb858cb1389bc5a9b39be96d8bb76d5ba6d58859eab32a496103d0d70218e994956fdd45e73e58a56881348b07503cdb177ee8836b797772af9d2743d58ed03 05-add-xt-dscp-mask-define.patch
b0b59a222ab44d1c4e90fed0506d38282e8a2dfbed4bde9c0c5e381ae40177d916abec984a2b66fbca9d96c3afe4e3fa0e0922a300e91cb8ac1020cb15a9f88b 06-set-BGR565-color-mode.patch"