diff options
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-kernel')
5 files changed, 0 insertions, 619 deletions
diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch deleted file mode 100644 index 1cfd330ab..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8e211c8bc64521d772c4389219889a240b40307b Mon Sep 17 00:00:00 2001 -From: Charles <Charles.Hsu@quantatw.com> -Date: Fri, 14 Aug 2020 18:06:22 +0800 -Subject: [PATCH] meta-gis: Enable adm1272 ADM1272_TEMP1_EN - ---- - drivers/hwmon/pmbus/adm1275.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c -index 5caa37fbfc18..550b9a8388f6 100644 ---- a/drivers/hwmon/pmbus/adm1275.c -+++ b/drivers/hwmon/pmbus/adm1275.c -@@ -595,11 +595,13 @@ static int adm1275_probe(struct i2c_client *client, - tindex = 8; - - info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | -- PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT; -+ PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | -+ PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; - -- /* Enable VOUT if not enabled (it is disabled by default) */ -- if (!(config & ADM1278_VOUT_EN)) { -- config |= ADM1278_VOUT_EN; -+ -+ /* Enable VOUT & TEMP1 if not enabled (it is disabled by default) */ -+ if ((config & (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) != (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) { -+ config |= ADM1278_VOUT_EN | ADM1278_TEMP1_EN; - ret = i2c_smbus_write_byte_data(client, - ADM1275_PMON_CONFIG, - config); -@@ -610,9 +612,7 @@ static int adm1275_probe(struct i2c_client *client, - } - } - -- if (config & ADM1278_TEMP1_EN) -- info->func[0] |= -- PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; -+ - if (config & ADM1278_VIN_EN) - info->func[0] |= PMBUS_HAVE_VIN; - break; --- -2.25.1 - diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-Add-kernel-seven-seg-display-support.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-Add-kernel-seven-seg-display-support.patch deleted file mode 100644 index a21707d8a..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-Add-kernel-seven-seg-display-support.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index b9e6d4c3e906..aa7ce9d72d2c 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -59,3 +59,5 @@ obj-$(CONFIG_HABANA_AI) += habanalabs/ - obj-$(CONFIG_XILINX_SDFEC) += xilinx_sdfec.o - obj-$(CONFIG_NPCM7XX_LPC_BPC) += npcm7xx-lpc-bpc.o - obj-$(CONFIG_NPCM7XX_PCI_MBOX) += npcm7xx-pci-mbox.o -+obj-$(CONFIG_SEVEN_SEGMENT_DISPLAY) += seven_seg_disp.o -+obj-$(CONFIG_SEVEN_SEGMENT_GPIO) += seven_seg_gpio.o diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch deleted file mode 100644 index 8ae624a51..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch +++ /dev/null @@ -1,293 +0,0 @@ -From 2d46e81d9bbb624695bac8400a4ac41b7f116ec4 Mon Sep 17 00:00:00 2001 -From: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Date: Fri, 27 Jul 2018 12:34:54 -0700 -Subject: [PATCH 2/3] drivers: misc: Character device driver for seven segment - display - -Character device driver which implements the user-space -API for letting a user write to two 7-segment displays including -any conversion methods necessary to map the user input -to two 7-segment displays. - -Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Signed-off-by: Kun Yi <kunyi@google.com> -Signed-off-by: Benjamin Fair <benjaminfair@google.com> ---- - drivers/misc/Kconfig | 8 ++ - drivers/misc/Makefile | 1 + - drivers/misc/seven_seg_disp.c | 201 ++++++++++++++++++++++++++++++++++ - drivers/misc/seven_seg_disp.h | 34 ++++++ - 4 files changed, 244 insertions(+) - create mode 100644 drivers/misc/seven_seg_disp.c - create mode 100644 drivers/misc/seven_seg_disp.h - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 9d96469fb41c..d443de886346 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -473,6 +473,14 @@ config VEXPRESS_SYSCFG - bus. System Configuration interface is one of the possible means - of generating transactions on this bus. - -+config SEVEN_SEGMENT_DISPLAY -+ tristate "Character driver for seven segment display support" -+ help -+ Character device driver which implements the user-space -+ API for letting a user write to two 7-segment displays including -+ any conversion methods necessary to map the user input -+ to two 7-segment displays. -+ - config PCI_ENDPOINT_TEST - depends on PCI - select CRC32 - -diff --git a/drivers/misc/seven_seg_disp.c b/drivers/misc/seven_seg_disp.c -new file mode 100644 -index 000000000000..db1c571f68e5 ---- /dev/null -+++ b/drivers/misc/seven_seg_disp.c -@@ -0,0 +1,201 @@ -+/* -+ * Copyright (c) 2016 Google, Inc -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 or later as -+ * published by the Free Software Foundation. -+ */ -+ -+#include <linux/module.h> -+#include <linux/version.h> -+#include <linux/kernel.h> -+#include <linux/types.h> -+#include <linux/kdev_t.h> -+#include <linux/fs.h> -+#include <linux/uaccess.h> -+#include <linux/ctype.h> -+#include <linux/of.h> -+#include <linux/io.h> -+#include <linux/slab.h> -+#include <linux/platform_device.h> -+ -+#include "seven_seg_disp.h" -+ -+#define LED_DOT 0x01 -+ -+/* -+ * 0 1 2 3 4 5 6 7 8 9 A B C D E F -+ * _ _ _ _ _ _ _ _ _ _ _ _ -+ * | | | _| _| |_| |_ |_ | |_| |_| |_| |_ | _| |_ |_ -+ * |_| | |_ _| | _| |_| | |_| | | | |_| |_ |_| |_ | -+ * -+ * data[7:1] = led[a:g] -+ */ -+const u8 seven_seg_bits[] = { -+ 0xFC, 0x60, 0xDA, 0xF2, 0x66, 0xB6, 0xBE, 0xE0, -+ 0xFE, 0xF6, 0xEE, 0x3E, 0x9C, 0x7A, 0x9E, 0x8E -+ }; -+ -+/* -+ * 0 1 2 3 4 5 6 7 8 9 A B C D E F -+ * _ _ _ _ _ -+ * | |_ |_| |_ _ _ _ _ _ _ _ |_ _| _| | | -+ * |_ |_ | | _| |_| |_| | | -+ * -+ * data[7:1] = led[a:g] -+ */ -+const u8 special_seven_seg_bits[] = { -+ 0x00, 0x9C, 0x1E, 0xCE, 0x8E, 0x02, 0x02, 0x02, -+ 0x02, 0x02, 0x02, 0x02, 0xB6, 0x7A, 0x7A, 0xEC -+ }; -+ -+static dev_t seven_seg_devno; -+static struct class *seven_seg_disp_class; -+ -+static int seven_seg_disp_open(struct inode *inode, struct file *filp) -+{ -+ struct seven_seg_disp_dev *disp_dev; -+ -+ disp_dev = container_of(inode->i_cdev, -+ struct seven_seg_disp_dev, cdev); -+ filp->private_data = disp_dev; -+ return 0; -+} -+ -+static int seven_seg_disp_close(struct inode *inode, struct file *filp) -+{ -+ filp->private_data = NULL; -+ return 0; -+} -+ -+static ssize_t seven_seg_disp_read(struct file *filp, char __user *buf, size_t -+ len, loff_t *off) -+{ -+ struct seven_seg_disp_dev *disp_dev = filp->private_data; -+ -+ if (disp_dev->disp_data_valid) -+ return -EINVAL; -+ -+ if (copy_to_user(buf, disp_dev->seven_seg_disp_data_array, -+ MAX_DISP_CHAR_SIZE) != 0) { -+ return -EFAULT; -+ } -+ -+ return 0; -+} -+ -+static u16 convert_to_disp_data(char *buf) -+{ -+ u8 low_display; -+ u8 high_display; -+ u16 led_value; -+ -+ low_display = seven_seg_bits[hex_to_bin(buf[2])]; -+ -+ high_display = (buf[0] == '1') ? -+ special_seven_seg_bits[hex_to_bin(buf[1])] : -+ seven_seg_bits[hex_to_bin(buf[1])]; -+ -+ led_value = low_display | (high_display << 8); -+ if (buf[0] == '1') -+ led_value |= LED_DOT | (LED_DOT << 8); -+ -+ return led_value; -+} -+ -+static ssize_t seven_seg_disp_write(struct file *filp, const char __user *buf, -+ size_t len, loff_t *off) -+{ -+ int length = len - 1; -+ int i; -+ -+ struct seven_seg_disp_dev *disp_dev = filp->private_data; -+ -+ if (length != MAX_DISP_CHAR_SIZE) -+ return -EINVAL; -+ -+ if (copy_from_user(disp_dev->seven_seg_disp_data_array, -+ buf, length) != 0) { -+ return -EFAULT; -+ } -+ -+ for (i = 0; i < MAX_DISP_CHAR_SIZE; i++) { -+ if (!isxdigit(disp_dev->seven_seg_disp_data_array[i])) -+ return -EINVAL; -+ } -+ -+ disp_dev->current_seven_seg_disp_data = convert_to_disp_data( -+ disp_dev->seven_seg_disp_data_array); -+ disp_dev->disp_data_valid = true; -+ disp_dev->update_seven_seg_data(&disp_dev->parent, -+ disp_dev->current_seven_seg_disp_data); -+ -+ return len; -+} -+ -+static const struct file_operations seven_seg_disp_fops = { -+ -+ .owner = THIS_MODULE, -+ .open = seven_seg_disp_open, -+ .release = seven_seg_disp_close, -+ .read = seven_seg_disp_read, -+ .write = seven_seg_disp_write -+}; -+ -+void seven_seg_rem_cdev(struct seven_seg_disp_dev *disp_dev) -+{ -+ cdev_del(&disp_dev->cdev); -+ device_destroy(seven_seg_disp_class, seven_seg_devno); -+} -+ -+int seven_seg_setup_cdev(struct seven_seg_disp_dev *disp_dev, -+ void (*update_disp_data)(struct device *, u16 data)) -+{ -+ struct device *dev; -+ int err; -+ -+ dev = device_create(seven_seg_disp_class, NULL, -+ seven_seg_devno, -+ NULL, "seven_seg_disp_val"); -+ if (dev == NULL) -+ return -EIO; -+ disp_dev->dev = dev; -+ disp_dev->update_seven_seg_data = update_disp_data; -+ disp_dev->disp_data_valid = false; -+ -+ cdev_init(&disp_dev->cdev, &seven_seg_disp_fops); -+ err = cdev_add(&disp_dev->cdev, seven_seg_devno, 1); -+ if (err) -+ device_destroy(seven_seg_disp_class, seven_seg_devno); -+ return err; -+} -+ -+static int __init seven_seg_disp_init(void) -+{ -+ int err = alloc_chrdev_region(&seven_seg_devno, 0, 1, "disp_state"); -+ -+ if (err < 0) -+ return err; -+ -+ seven_seg_disp_class = class_create(THIS_MODULE, "disp_state"); -+ if (seven_seg_disp_class == NULL) -+ goto unreg_chrdev; -+ -+ return 0; -+ -+unreg_chrdev: -+ unregister_chrdev_region(seven_seg_devno, 1); -+ return -EIO; -+} -+ -+static void __exit seven_seg_disp_exit(void) -+{ -+ class_destroy(seven_seg_disp_class); -+ unregister_chrdev_region(seven_seg_devno, 1); -+} -+ -+module_init(seven_seg_disp_init); -+module_exit(seven_seg_disp_exit); -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>"); -+MODULE_DESCRIPTION("Seven segment display character driver"); -diff --git a/drivers/misc/seven_seg_disp.h b/drivers/misc/seven_seg_disp.h -new file mode 100644 -index 000000000000..0ebed0802747 ---- /dev/null -+++ b/drivers/misc/seven_seg_disp.h -@@ -0,0 +1,34 @@ -+/* -+ * Copyright (c) 2016 Google, Inc -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 or later as -+ * published by the Free Software Foundation. -+ */ -+ -+#ifndef SEVEN_SEG_DISP_H -+#define SEVEN_SEG_DISP_H -+ -+#include <linux/device.h> -+#include <linux/cdev.h> -+ -+#define MAX_DISP_CHAR_SIZE 3 -+ -+#define DEFAULT_REFRESH_INTERVAL_MS 600 -+ -+struct seven_seg_disp_dev { -+ bool disp_data_valid; -+ u16 current_seven_seg_disp_data; -+ char seven_seg_disp_data_array[MAX_DISP_CHAR_SIZE]; -+ struct device parent; -+ struct device *dev; -+ struct cdev cdev; -+ void (*update_seven_seg_data)(struct device *, u16 data); -+}; -+ -+int seven_seg_setup_cdev(struct seven_seg_disp_dev *disp_dev, -+ void (*update_disp_data)(struct device *, u16 data)); -+ -+void seven_seg_rem_cdev(struct seven_seg_disp_dev *disp_dev); -+ -+#endif --- -2.22.0.770.g0f2c4a37fd-goog - diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch deleted file mode 100644 index b166c78b8..000000000 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton/0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch +++ /dev/null @@ -1,267 +0,0 @@ -From ea3e732d2c4a609e621346a96d37713820640196 Mon Sep 17 00:00:00 2001 -From: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Date: Fri, 27 Jul 2018 12:36:24 -0700 -Subject: [PATCH 3/3] drivers: misc: Platform driver for seven segment display - support - -Platform device driver which provides an API for displaying on two -7-segment displays, and implements the required bit-banging. -The hardware assumed is 74HC164 wired to two 7-segment displays. - -Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> -Signed-off-by: Kun Yi <kunyi@google.com> -Signed-off-by: Benjamin Fair <benjaminfair@google.com> ---- - drivers/misc/Kconfig | 8 ++ -# drivers/misc/Makefile | 2 ++ - drivers/misc/seven_seg_gpio.c | 205 ++++++++++++++++++++++++++++++++++ - 3 files changed, 215 insertions(+) - create mode 100644 drivers/misc/seven_seg_gpio.c - -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index d443de886346..e10984e3288f 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -481,6 +481,14 @@ config SEVEN_SEGMENT_DISPLAY - any conversion methods necessary to map the user input - to two 7-segment displays. - -+config SEVEN_SEGMENT_GPIO -+ tristate "Platform driver to update seven segment display" -+ depends on SEVEN_SEGMENT_DISPLAY -+ help -+ Platform device driver which provides an API for displaying on two -+ 7-segment displays, and implements the required bit-banging. -+ The hardware assumed is 74HC164 wired to two 7-segment displays. -+ - config PCI_ENDPOINT_TEST - depends on PCI - select CRC32 -# diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -# index 402bcc3c9961..f39bec664d92 100644 -# --- a/drivers/misc/Makefile -# +++ b/drivers/misc/Makefile -# @@ -53,6 +53,8 @@ obj-$(CONFIG_GENWQE) += genwqe/ -# obj-$(CONFIG_ECHO) += echo/ -# obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o -# obj-$(CONFIG_CXL_BASE) += cxl/ -# +obj-$(CONFIG_SEVEN_SEGMENT_DISPLAY) += seven_seg_disp.o -# +obj-$(CONFIG_SEVEN_SEGMENT_GPIO) += seven_seg_gpio.o -# obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o -# obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o -# obj-$(CONFIG_ASPEED_LPC_MBOX) += aspeed-lpc-mbox.o - -diff --git a/drivers/misc/seven_seg_gpio.c b/drivers/misc/seven_seg_gpio.c -new file mode 100644 -index 000000000000..e03ea7f8b848 ---- /dev/null -+++ b/drivers/misc/seven_seg_gpio.c -@@ -0,0 +1,205 @@ -+/* -+ * Copyright (C) 2016 Google, Inc -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 or later as -+ * published by the Free Software Foundation. -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/module.h> -+#include <linux/timer.h> -+#include <linux/jiffies.h> -+#include <linux/sizes.h> -+#include <linux/io.h> -+#include <linux/delay.h> -+#include <linux/uaccess.h> -+#include <linux/mutex.h> -+#include <linux/of_platform.h> -+#include <linux/gpio/consumer.h> -+ -+#include "seven_seg_disp.h" -+ -+#define DELAY_INTVL_US 1 -+ -+#define CLOCK_GPIO_NAME "clock" -+#define DATA_GPIO_NAME "data" -+#define CLEAR_GPIO_NAME "clear" -+ -+struct seven_seg_gpio_info { -+ u16 curr_disp_value; -+ u16 refresh_interval; -+ struct timer_list update_timer; -+ struct gpio_desc *clock_gpio; -+ struct gpio_desc *data_gpio; -+ struct gpio_desc *clear_gpio; -+}; -+ -+static void update_seven_seg_gpio_data(struct device *dev, u16 data) -+{ -+ struct platform_device *pdev; -+ struct seven_seg_gpio_info *gpio_info; -+ -+ pdev = container_of(dev, struct platform_device, dev); -+ if (pdev == NULL) { -+ pr_err("invalid NULL platform_device\n"); -+ return; -+ } -+ -+ gpio_info = platform_get_drvdata(pdev); -+ if (gpio_info == NULL) { -+ pr_err("invalid NULL gpio_info\n"); -+ return; -+ } -+ -+ gpio_info->curr_disp_value = data; -+} -+ -+static void clear_seven_seg_gpio_data(struct device *dev, u16 data) -+{ -+ struct platform_device *pdev; -+ struct seven_seg_gpio_info *gpio_info; -+ -+ pdev = container_of(dev, struct platform_device, dev); -+ if (pdev == NULL) { -+ pr_err("invalid NULL platform_device\n"); -+ return; -+ } -+ -+ gpio_info = platform_get_drvdata(pdev); -+ if (gpio_info == NULL) { -+ pr_err("invalid NULL gpio_info\n"); -+ return; -+ } -+ -+ gpio_info->curr_disp_value = 0; -+} -+ -+static void send_seven_seg_gpio_data(u16 disp_data, -+ struct seven_seg_gpio_info *gpio_info) -+{ -+ int i; -+ -+ gpiod_set_value(gpio_info->clear_gpio, 0); -+ udelay(DELAY_INTVL_US); -+ gpiod_set_value(gpio_info->clear_gpio, 1); -+ udelay(DELAY_INTVL_US); -+ -+ for (i = 0; i < 16; i++) { -+ if (disp_data & 0x01) -+ gpiod_set_value(gpio_info->data_gpio, 1); -+ else -+ gpiod_set_value(gpio_info->data_gpio, 0); -+ -+ udelay(DELAY_INTVL_US); -+ -+ gpiod_set_value(gpio_info->clock_gpio, 0); -+ udelay(DELAY_INTVL_US); -+ gpiod_set_value(gpio_info->clock_gpio, 1); -+ udelay(DELAY_INTVL_US); -+ -+ disp_data >>= 1; -+ } -+} -+ -+static void disp_refresh_timer_handler(struct timer_list *t) -+{ -+ u16 disp_data; -+ struct seven_seg_gpio_info *gpio_info = -+ from_timer(gpio_info, t, update_timer); -+ disp_data = gpio_info->curr_disp_value; -+ -+ send_seven_seg_gpio_data(disp_data, gpio_info); -+ mod_timer(&gpio_info->update_timer, -+ jiffies + msecs_to_jiffies(gpio_info->refresh_interval)); -+} -+ -+static const struct of_device_id of_seven_seg_gpio_match[] = { -+ { .compatible = "seven-seg-gpio-dev" }, -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(of, of_seven_seg_gpio_match); -+ -+static int seven_seg_gpio_probe(struct platform_device *pdev) -+{ -+ u16 interval; -+ int result; -+ struct seven_seg_gpio_info *gpio_info; -+ struct device *dev = &pdev->dev; -+ struct seven_seg_disp_dev *disp_dev; -+ -+ gpio_info = devm_kzalloc(dev, -+ sizeof(struct seven_seg_gpio_info), -+ GFP_KERNEL); -+ if (gpio_info == NULL) -+ return -ENOMEM; -+ -+ /* Requesting the clock gpio */ -+ gpio_info->clock_gpio = devm_gpiod_get(dev, CLOCK_GPIO_NAME, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(gpio_info->clock_gpio)) -+ return PTR_ERR(gpio_info->clock_gpio); -+ -+ /* Requesting the data gpio */ -+ gpio_info->data_gpio = devm_gpiod_get(dev, DATA_GPIO_NAME, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(gpio_info->data_gpio)) -+ return PTR_ERR(gpio_info->data_gpio); -+ -+ /* Requesting the clear gpio */ -+ gpio_info->clear_gpio = devm_gpiod_get(dev, CLEAR_GPIO_NAME, -+ GPIOD_OUT_HIGH); -+ if (IS_ERR(gpio_info->clear_gpio)) -+ return PTR_ERR(gpio_info->clear_gpio); -+ -+ result = of_property_read_u16(pdev->dev.of_node, -+ "refresh-interval-ms", &interval); -+ gpio_info->refresh_interval = result ? DEFAULT_REFRESH_INTERVAL_MS : -+ interval; -+ -+ /* Start timer to update seven segment display every second */ -+ timer_setup(&gpio_info->update_timer, disp_refresh_timer_handler, 0); -+ result = mod_timer(&gpio_info->update_timer, -+ jiffies + -+ msecs_to_jiffies(gpio_info->refresh_interval)); -+ if (result) -+ return result; -+ -+ gpio_info->curr_disp_value = 0; -+ -+ platform_set_drvdata(pdev, gpio_info); -+ -+ disp_dev = devm_kzalloc(dev, sizeof(struct seven_seg_disp_dev), -+ GFP_KERNEL); -+ disp_dev->parent = *dev; -+ seven_seg_setup_cdev(disp_dev, &update_seven_seg_gpio_data); -+ return 0; -+} -+ -+static int seven_seg_gpio_remove(struct platform_device *pdev) -+{ -+ struct seven_seg_gpio_info *gpio_info = platform_get_drvdata(pdev); -+ struct seven_seg_disp_dev *disp_dev = -+ container_of(&pdev->dev, -+ struct seven_seg_disp_dev, parent); -+ seven_seg_rem_cdev(disp_dev); -+ del_timer_sync(&gpio_info->update_timer); -+ platform_set_drvdata(pdev, NULL); -+ return 0; -+} -+ -+static struct platform_driver seven_seg_gpio_driver = { -+ .probe = seven_seg_gpio_probe, -+ .remove = seven_seg_gpio_remove, -+ .driver = { -+ .name = "seven-seg-gpio", -+ .of_match_table = of_seven_seg_gpio_match, -+ }, -+}; -+ -+module_platform_driver(seven_seg_gpio_driver); -+ -+MODULE_LICENSE("GPL"); -+MODULE_AUTHOR("Jaghathiswari Rankappagounder Natarajan <jaghu@google.com>"); -+MODULE_DESCRIPTION("Seven segment display driver using GPIO config"); --- -2.22.0.770.g0f2c4a37fd-goog - diff --git a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend index e5fadfe05..c2b5da404 100644 --- a/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-kernel/linux/linux-nuvoton_%.bbappend @@ -1,6 +1,2 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/linux-nuvoton:" SRC_URI_append_gbs = " file://gbs.cfg" -SRC_URI_append_gbs = " file://0004-Add-kernel-seven-seg-display-support.patch" -SRC_URI_append_gbs = " file://0004-ben-drivers-misc-Character-device-driver-for-seven-segme.patch" -SRC_URI_append_gbs = " file://0004-ben-drivers-misc-Platform-driver-for-seven-segment-displ.patch" -SRC_URI_append_gbs = " file://0001-meta-gbs-Enable-adm1272-ADM1272_TEMP1_EN.patch" |