RK3399: add khadas-edge

This commit is contained in:
Jonas Karlman 2018-12-17 07:44:40 +01:00
parent 38142fec0f
commit 83470fe786
7 changed files with 1245 additions and 0 deletions

View File

@ -16,6 +16,7 @@ This project is for Rockchip SoC devices
**RK3399**
* [96rocks ROCK960](devices/RK3399)
* [Khadas Edge](devices/RK3399)
* [PINE64 RockPro64](devices/RK3399)
* [Rockchip Sapphire Board](devices/RK3399)

View File

@ -4,6 +4,7 @@ This is a SoC device for RK3399
**Build**
* `PROJECT=Rockchip DEVICE=RK3399 ARCH=arm UBOOT_SYSTEM=khadas-edge make image`
* `PROJECT=Rockchip DEVICE=RK3399 ARCH=arm UBOOT_SYSTEM=rock960 make image`
* `PROJECT=Rockchip DEVICE=RK3399 ARCH=arm UBOOT_SYSTEM=rockpro64 make image`
* `PROJECT=Rockchip DEVICE=RK3399 ARCH=arm UBOOT_SYSTEM=sapphire make image`

View File

@ -26,6 +26,7 @@
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
KERNEL_MAKE_EXTRACMD=""
KERNEL_MAKE_EXTRACMD+=" rockchip/rk3399-khadas-edge.dtb"
KERNEL_MAKE_EXTRACMD+=" rockchip/rk3399-rock960.dtb"
KERNEL_MAKE_EXTRACMD+=" rockchip/rk3399-rockpro64.dtb"
KERNEL_MAKE_EXTRACMD+=" rockchip/rk3399-sapphire.dtb"

View File

@ -1395,3 +1395,52 @@ index 34757168ffaa..0914c886277f 100644
if (u->unique_len >= master->unique_len) {
if (copy_to_user(u->unique, master->unique, master->unique_len))
return -EFAULT;
From 309a27eaf2f4e429ef102e3eef70a2f908360c44 Mon Sep 17 00:00:00 2001
From: Nick <nick@khadas.com>
Date: Wed, 19 Sep 2018 22:14:58 +0800
Subject: [PATCH] bump PD voltage & current for board without charge IC
---
drivers/mfd/fusb302.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/fusb302.c b/drivers/mfd/fusb302.c
index 240cecac65b5..8fe4163214e0 100644
--- a/drivers/mfd/fusb302.c
+++ b/drivers/mfd/fusb302.c
@@ -217,8 +217,32 @@ static int fusb302_set_pos_power_by_charge_ic(struct fusb30x_chip *chip)
max_vol = 0;
max_cur = 0;
psy = power_supply_get_by_phandle(chip->dev->of_node, "charge-dev");
- if (!psy || IS_ERR(psy))
- return -1;
+ if (!psy || IS_ERR(psy)) {
+ int ret;
+ u32 value;
+
+ ret = of_property_read_u32(chip->dev->of_node, "max-input-voltage", &value);
+ if (ret) {
+ dev_err(chip->dev, "'max-input-voltage' not found!\n");
+ return -1;
+ }
+
+ max_vol = value / 1000;
+
+ ret = of_property_read_u32(chip->dev->of_node, "max-input-current", &value);
+
+ if (ret) {
+ dev_err(chip->dev, "'max-input-current' not found!\n");
+ return -1;
+ }
+
+ max_cur = value / 1000;
+
+ if (max_vol > 0 && max_cur > 0)
+ fusb_set_pos_power(chip, max_vol, max_cur);
+
+ return 0;
+ }
psp = POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX;
if (power_supply_get_property(psy, psp, &val) == 0)

View File

@ -645,3 +645,99 @@ index 8bbe335e650c..66e1c50b38fc 100644
#define RC_MAP_WETEK_HUB "rc-wetek-hub"
#define RC_MAP_WETEK_PLAY_2 "rc-wetek-play-2"
#define RC_MAP_VIDEOMATE_K100 "rc-videomate-k100"
From 312b78202feca8f3966343b0362466e9c6ff2297 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Mon, 17 Dec 2018 07:41:16 +0100
Subject: [PATCH] [media] rc/keymaps: add keytable for Khadas IR Remote
Controller
---
drivers/media/rc/keymaps/Makefile | 1 +
drivers/media/rc/keymaps/rc-khadas.c | 52 ++++++++++++++++++++++++++++++++++++
include/media/rc-map.h | 1 +
3 files changed, 54 insertions(+)
create mode 100644 drivers/media/rc/keymaps/rc-khadas.c
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index 2aaa1b33ddca..fc0207d322a0 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -47,6 +47,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
rc-it913x-v1.o \
rc-it913x-v2.o \
rc-kaiomy.o \
+ rc-khadas.o \
rc-kworld-315u.o \
rc-kworld-pc150u.o \
rc-kworld-plus-tv-analog.o \
diff --git a/drivers/media/rc/keymaps/rc-khadas.c b/drivers/media/rc/keymaps/rc-khadas.c
new file mode 100644
index 000000000000..492368db75d9
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-khadas.c
@@ -0,0 +1,52 @@
+/* Keytable for Khadas IR Remote Controller
+ *
+ * Copyright (c) 2018 Shenzhen Wesion Technology Co., Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+static struct rc_map_table khadas[] = {
+ { 0x14, KEY_POWER },
+ { 0x07, KEY_OK },
+ { 0x03, KEY_UP },
+ { 0x02, KEY_DOWN },
+ { 0x0e, KEY_LEFT },
+ { 0x1a, KEY_RIGHT },
+ { 0x13, KEY_MENU },
+ { 0x01, KEY_BACK },
+ { 0x0b, KEY_VOLUMEUP },
+ { 0x58, KEY_VOLUMEDOWN },
+ { 0x48, KEY_HOME },
+ { 0x5b, KEY_CONTEXT_MENU },
+};
+
+static struct rc_map_list khadas_map = {
+ .map = {
+ .scan = khadas,
+ .size = ARRAY_SIZE(khadas),
+ .rc_type = RC_TYPE_NEC,
+ .name = RC_MAP_KHADAS,
+ }
+};
+
+static int __init init_rc_map_khadas(void)
+{
+ return rc_map_register(&khadas_map);
+}
+
+static void __exit exit_rc_map_khadas(void)
+{
+ rc_map_unregister(&khadas_map);
+}
+
+module_init(init_rc_map_khadas)
+module_exit(exit_rc_map_khadas)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Khadas");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 66e1c50b38fc..6b2db526fac0 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -154,6 +154,7 @@ void rc_map_init(void);
#define RC_MAP_IT913X_V1 "rc-it913x-v1"
#define RC_MAP_IT913X_V2 "rc-it913x-v2"
#define RC_MAP_KAIOMY "rc-kaiomy"
+#define RC_MAP_KHADAS "rc-khadas"
#define RC_MAP_KWORLD_315U "rc-kworld-315u"
#define RC_MAP_KWORLD_PC150U "rc-kworld-pc150u"
#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"

View File

@ -20,6 +20,7 @@ devices = {
'rockbox' : { 'dtb' : 'rk3328-rockbox.dtb', 'config' : 'evb-rk3328_defconfig' },
},
'RK3399' : {
'khadas-edge' : { 'dtb' : 'rk3399-khadas-edge.dtb', 'config' : 'evb-rk3399_config' },
'rock960' : { 'dtb' : 'rk3399-rock960.dtb', 'config' : 'evb-rk3399_config' },
'rockpro64' : { 'dtb' : 'rk3399-rockpro64.dtb', 'config' : 'evb-rk3399_config' },
'sapphire' : { 'dtb' : 'rk3399-sapphire.dtb', 'config' : 'evb-rk3399_config' },