kernel-release 5.10.3-1 (aarch64;x86_64) 2020-13403
9999

Submitter benbullard79 [@T] cox.net
Platform rolling
Repository main
URL https://abf.openmandriva.org/build_lists/927607
Packages
cross-aarch64-openmandriva-linux-android-kernel-release-headers-5.10.3-1.aarch64.binary
cross-aarch64-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.aarch64.binary
cross-aarch64-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.aarch64.binary
cross-armv7hnl-openmandriva-linux-gnueabihf-kernel-release-headers-5.10.3-1.aarch64.binary
cross-armv7hnl-openmandriva-linux-musleabihf-kernel-release-headers-5.10.3-1.aarch64.binary
cross-armv7hnl-openmandriva-linux-uclibceabihf-kernel-release-headers-5.10.3-1.aarch64.binary
cross-armv7l-openmandriva-linux-androideabi-kernel-release-headers-5.10.3-1.aarch64.binary
cross-armv8l-openmandriva-linux-androideabi-kernel-release-headers-5.10.3-1.aarch64.binary
cross-i686-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.aarch64.binary
cross-i686-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.aarch64.binary
cross-i686-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.aarch64.binary
cross-ppc64le-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.aarch64.binary
cross-ppc64-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.aarch64.binary
cross-riscv32-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.aarch64.binary
cross-riscv32-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.aarch64.binary
cross-riscv32-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.aarch64.binary
cross-riscv64-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.aarch64.binary
cross-riscv64-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.aarch64.binary
cross-riscv64-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-android-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-gnux32-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-muslx32-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.aarch64.binary
cross-x86_64-openmandriva-linux-uclibcx32-kernel-release-headers-5.10.3-1.aarch64.binary
kernel-release-5.10.3-1.aarch64.source
kernel-release-headers-1:5.10.3-1.aarch64.binary
kernel-release-server-5.10.3-1.aarch64.binary
kernel-release-server-clang-5.10.3-1.aarch64.binary
kernel-release-server-clang-devel-5.10.3-1.aarch64.binary
kernel-release-server-devel-5.10.3-1.aarch64.binary
kernel-release-source-5.10.3-1.aarch64.binary
bpftool-5.10.3-1.x86_64.binary
cpupower-5.10.3-1.x86_64.binary
cpupower-devel-5.10.3-1.x86_64.binary
cross-aarch64-openmandriva-linux-android-kernel-release-headers-5.10.3-1.x86_64.binary
cross-aarch64-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.x86_64.binary
cross-aarch64-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.x86_64.binary
cross-aarch64-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.x86_64.binary
cross-armv7hnl-openmandriva-linux-gnueabihf-kernel-release-headers-5.10.3-1.x86_64.binary
cross-armv7hnl-openmandriva-linux-musleabihf-kernel-release-headers-5.10.3-1.x86_64.binary
cross-armv7hnl-openmandriva-linux-uclibceabihf-kernel-release-headers-5.10.3-1.x86_64.binary
cross-armv7l-openmandriva-linux-androideabi-kernel-release-headers-5.10.3-1.x86_64.binary
cross-armv8l-openmandriva-linux-androideabi-kernel-release-headers-5.10.3-1.x86_64.binary
cross-i686-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.x86_64.binary
cross-i686-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.x86_64.binary
cross-i686-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.x86_64.binary
cross-ppc64le-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.x86_64.binary
cross-ppc64-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.x86_64.binary
cross-riscv32-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.x86_64.binary
cross-riscv32-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.x86_64.binary
cross-riscv32-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.x86_64.binary
cross-riscv64-openmandriva-linux-gnu-kernel-release-headers-5.10.3-1.x86_64.binary
cross-riscv64-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.x86_64.binary
cross-riscv64-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.x86_64.binary
cross-x86_64-openmandriva-linux-android-kernel-release-headers-5.10.3-1.x86_64.binary
cross-x86_64-openmandriva-linux-gnux32-kernel-release-headers-5.10.3-1.x86_64.binary
cross-x86_64-openmandriva-linux-musl-kernel-release-headers-5.10.3-1.x86_64.binary
cross-x86_64-openmandriva-linux-muslx32-kernel-release-headers-5.10.3-1.x86_64.binary
cross-x86_64-openmandriva-linux-uclibc-kernel-release-headers-5.10.3-1.x86_64.binary
cross-x86_64-openmandriva-linux-uclibcx32-kernel-release-headers-5.10.3-1.x86_64.binary
kernel-release-5.10.3-1.x86_64.source
kernel-release-desktop-5.10.3-1.x86_64.binary
kernel-release-desktop-clang-5.10.3-1.x86_64.binary
kernel-release-desktop-clang-devel-5.10.3-1.x86_64.binary
kernel-release-desktop-devel-5.10.3-1.x86_64.binary
kernel-release-headers-1:5.10.3-1.x86_64.binary
kernel-release-server-5.10.3-1.x86_64.binary
kernel-release-server-clang-5.10.3-1.x86_64.binary
kernel-release-server-clang-devel-5.10.3-1.x86_64.binary
kernel-release-server-devel-5.10.3-1.x86_64.binary
kernel-release-source-5.10.3-1.x86_64.binary
lib64bpf0-5.10.3-1.x86_64.binary
lib64bpf-devel-5.10.3-1.x86_64.binary
turbostat-5.10.3-1.x86_64.binary
x86_energy_perf_policy-5.10.3-1.x86_64.binary
Build Date 2020-12-27 08:54:01 +0000 UTC
Last Updated 2020-12-28 18:46:33.252182683 +0000 UTC
$ git diff --patch-with-stat --summary e7aba089624583386cf84083ceeacbe954b2409b..968aeefc498fb4d7b47f4f3dacb02cc8f14476cc

 .abf.yml                                           |    2 +-
 ...req-Avoid-configuring-old-governors-as-de.patch |   38 +
 aarch64-desktop-omv-defconfig                      |   11 +-
 aarch64-server-omv-defconfig                       |   11 +-
 add-amd-sfh-hid_driver.patch                       | 1783 ++++++++++++++++++++
 add-sbtsi_driver.patch                             |  285 ++++
 armv7hnl-desktop-omv-defconfig                     |    2 +
 armv7hnl-server-omv-defconfig                      |    2 +
 enable-new-amd-energy-driver-for-all-ryzen.patch   |    8 +-
 export-symbols-needed-by-android-drivers.patch     |   22 +
 i686-desktop-gcc-omv-defconfig                     |    2 +
 i686-server-gcc-omv-defconfig                      |    2 +
 k10temp-fix-ZEN2-desktop-add-ZEN3-desktop.patch    |   94 ++
 kernel-release.spec                                |   19 +-
 ...d326ab2dffbed92faddf6a77a84e9-no-Intel-NO.patch |   12 +
 x86_64-desktop-gcc-omv-defconfig                   |   12 +-
 x86_64-server-gcc-omv-defconfig                    |   12 +-
 x86_64-znver-desktop-gcc-omv-defconfig             |   12 +-
 x86_64-znver-server-gcc-omv-defconfig              |   12 +-
 19 files changed, 2327 insertions(+), 14 deletions(-)
 create mode 100644 0001-Revert-cpufreq-Avoid-configuring-old-governors-as-de.patch
 create mode 100644 add-amd-sfh-hid_driver.patch
 create mode 100644 add-sbtsi_driver.patch
 create mode 100644 k10temp-fix-ZEN2-desktop-add-ZEN3-desktop.patch
 create mode 100644 revert-parts-of-a00ec3874e7d326ab2dffbed92faddf6a77a84e9-no-Intel-NO.patch

diff --git a/.abf.yml b/.abf.yml
index baafe4e..6464e1d 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -2,4 +2,4 @@ sources:
   extra-wifi-drivers-20200301.tar.zst: 3390c738c7d91250714ce0f88d26371e93bc40b8
   saa716x-driver.tar.xz: f9b6ef1cd6f1f71f53d9a8aadfba2cf6b5c3d7b6
   linux-5.10.tar.xz: be0b909f1fbb760cc2d5cf146e1da3b2af0cf899
-  patch-5.10.2.xz: 4ee420818a2cc8a8025bb594f0033cce150a005b
+  patch-5.10.3.xz: 7ddbbe8a49fb5ad8f2ed7aa70c4efbfdd4685bc1
diff --git a/0001-Revert-cpufreq-Avoid-configuring-old-governors-as-de.patch b/0001-Revert-cpufreq-Avoid-configuring-old-governors-as-de.patch
new file mode 100644
index 0000000..e8ef9b4
--- /dev/null
+++ b/0001-Revert-cpufreq-Avoid-configuring-old-governors-as-de.patch
@@ -0,0 +1,38 @@
+From 2261dd7a91c24db2da4c9c5abf6a1670fcba1c0e Mon Sep 17 00:00:00 2001
+From: Gabriel C <crazy@frugalware.org>
+Date: Tue, 15 Dec 2020 20:12:13 +0100
+Subject: [PATCH] Revert "cpufreq: Avoid configuring old governors as default
+ with intel_pstate"
+
+This reverts commit db865272d9c4687520dc29f77e701a1b2669872f.
+
+This is crazy stuff. These changes belong to an initramfs generator like dracut.
+So you are forcing schedutil on everyone because a generic distro kernel may select
+that driver? Uff.. fix it for every CPU then we can talk about it.
+---
+ drivers/cpufreq/Kconfig | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
+index 85de313ddec2..2c7171e0b001 100644
+--- a/drivers/cpufreq/Kconfig
++++ b/drivers/cpufreq/Kconfig
+@@ -71,7 +71,6 @@ config CPU_FREQ_DEFAULT_GOV_USERSPACE
+ 
+ config CPU_FREQ_DEFAULT_GOV_ONDEMAND
+ 	bool "ondemand"
+-	depends on !(X86_INTEL_PSTATE && SMP)
+ 	select CPU_FREQ_GOV_ONDEMAND
+ 	select CPU_FREQ_GOV_PERFORMANCE
+ 	help
+@@ -84,7 +83,6 @@ config CPU_FREQ_DEFAULT_GOV_ONDEMAND
+ 
+ config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
+ 	bool "conservative"
+-	depends on !(X86_INTEL_PSTATE && SMP)
+ 	select CPU_FREQ_GOV_CONSERVATIVE
+ 	select CPU_FREQ_GOV_PERFORMANCE
+ 	help
+-- 
+2.29.2
+
diff --git a/aarch64-desktop-omv-defconfig b/aarch64-desktop-omv-defconfig
index e060ea9..aa1d2ea 100644
--- a/aarch64-desktop-omv-defconfig
+++ b/aarch64-desktop-omv-defconfig
@@ -4799,6 +4799,8 @@ CONFIG_SENSORS_LM90=m
 # CONFIG_SENSORS_PWM_FAN is not set
 CONFIG_SENSORS_RASPBERRYPI_HWMON=m
 CONFIG_SENSORS_SL28CPLD=m
+# CONFIG_SENSORS_SBTSI is not set
+# CONFIG_AMD_SFH_HID is not set
 # CONFIG_SENSORS_SHT15 is not set
 # CONFIG_SENSORS_SHT21 is not set
 # CONFIG_SENSORS_SHT3x is not set
@@ -9361,7 +9363,14 @@ CONFIG_USB4=m
 # Android
 #
 CONFIG_ANDROID=y
-# CONFIG_ANDROID_BINDER_IPC is not set
+CONFIG_ANDROID_BINDER_IPC=m
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
+CONFIG_ASHMEM=m
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
 # end of Android
 
 CONFIG_LIBNVDIMM=y
diff --git a/aarch64-server-omv-defconfig b/aarch64-server-omv-defconfig
index 0c26bed..8745443 100644
--- a/aarch64-server-omv-defconfig
+++ b/aarch64-server-omv-defconfig
@@ -4799,6 +4799,8 @@ CONFIG_SENSORS_LM90=m
 # CONFIG_SENSORS_PWM_FAN is not set
 CONFIG_SENSORS_RASPBERRYPI_HWMON=m
 CONFIG_SENSORS_SL28CPLD=m
+# CONFIG_SENSORS_SBTSI is not set
+# CONFIG_AMD_SFH_HID is not set
 # CONFIG_SENSORS_SHT15 is not set
 # CONFIG_SENSORS_SHT21 is not set
 # CONFIG_SENSORS_SHT3x is not set
@@ -9361,7 +9363,14 @@ CONFIG_USB4=m
 # Android
 #
 CONFIG_ANDROID=y
-# CONFIG_ANDROID_BINDER_IPC is not set
+CONFIG_ANDROID_BINDER_IPC=m
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
+CONFIG_ASHMEM=m
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
 # end of Android
 
 CONFIG_LIBNVDIMM=y
diff --git a/add-amd-sfh-hid_driver.patch b/add-amd-sfh-hid_driver.patch
new file mode 100644
index 0000000..dd8bade
--- /dev/null
+++ b/add-amd-sfh-hid_driver.patch
@@ -0,0 +1,1783 @@
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_client.c linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_client.c
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_client.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_client.c	2020-12-25 14:25:44.298391979 +0100
+@@ -0,0 +1,246 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ *  AMD SFH Client Layer
++ *  Copyright 2020 Advanced Micro Devices, Inc.
++ *  Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
++ *	     Sandeep Singh <Sandeep.singh@amd.com>
++ */
++
++#include <linux/dma-mapping.h>
++#include <linux/hid.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/workqueue.h>
++#include <linux/errno.h>
++
++#include "hid_descriptor/amd_sfh_hid_desc.h"
++#include "amd_sfh_pcie.h"
++#include "amd_sfh_hid.h"
++
++#define AMD_SFH_IDLE_LOOP	200
++
++struct request_list {
++	struct hid_device *hid;
++	struct list_head list;
++	u8 report_id;
++	u8 sensor_idx;
++	u8 report_type;
++	u8 current_index;
++};
++
++static struct request_list req_list;
++
++void amd_sfh_set_report(struct hid_device *hid, int report_id,
++			int report_type)
++{
++	struct amdtp_hid_data *hid_data = hid->driver_data;
++	struct amdtp_cl_data *cli_data = hid_data->cli_data;
++	int i;
++
++	for (i = 0; i < cli_data->num_hid_devices; i++) {
++		if (cli_data->hid_sensor_hubs[i] == hid) {
++			cli_data->cur_hid_dev = i;
++			break;
++		}
++	}
++	amdtp_hid_wakeup(hid);
++}
++
++int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)
++{
++	struct amdtp_hid_data *hid_data = hid->driver_data;
++	struct amdtp_cl_data *cli_data = hid_data->cli_data;
++	int i;
++
++	for (i = 0; i < cli_data->num_hid_devices; i++) {
++		if (cli_data->hid_sensor_hubs[i] == hid) {
++			struct request_list *new = kzalloc(sizeof(*new), GFP_KERNEL);
++
++			if (!new)
++				return -ENOMEM;
++
++			new->current_index = i;
++			new->sensor_idx = cli_data->sensor_idx[i];
++			new->hid = hid;
++			new->report_type = report_type;
++			new->report_id = report_id;
++			cli_data->report_id[i] = report_id;
++			cli_data->request_done[i] = false;
++			list_add(&new->list, &req_list.list);
++			break;
++		}
++	}
++	schedule_delayed_work(&cli_data->work, 0);
++	return 0;
++}
++
++static void amd_sfh_work(struct work_struct *work)
++{
++	struct amdtp_cl_data *cli_data = container_of(work, struct amdtp_cl_data, work.work);
++	struct request_list *req_node;
++	u8 current_index, sensor_index;
++	u8 report_id, node_type;
++	u8 report_size = 0;
++
++	req_node = list_last_entry(&req_list.list, struct request_list, list);
++	list_del(&req_node->list);
++	current_index = req_node->current_index;
++	sensor_index = req_node->sensor_idx;
++	report_id = req_node->report_id;
++	node_type = req_node->report_type;
++
++	if (node_type == HID_FEATURE_REPORT) {
++		report_size = get_feature_report(sensor_index, report_id,
++						 cli_data->feature_report[current_index]);
++		if (report_size)
++			hid_input_report(cli_data->hid_sensor_hubs[current_index],
++					 cli_data->report_type[current_index],
++					 cli_data->feature_report[current_index], report_size, 0);
++		else
++			pr_err("AMDSFH: Invalid report size\n");
++
++	} else if (node_type == HID_INPUT_REPORT) {
++		report_size = get_input_report(sensor_index, report_id,
++					       cli_data->input_report[current_index],
++					       cli_data->sensor_virt_addr[current_index]);
++		if (report_size)
++			hid_input_report(cli_data->hid_sensor_hubs[current_index],
++					 cli_data->report_type[current_index],
++					 cli_data->input_report[current_index], report_size, 0);
++		else
++			pr_err("AMDSFH: Invalid report size\n");
++	}
++	cli_data->cur_hid_dev = current_index;
++	cli_data->sensor_requested_cnt[current_index] = 0;
++	amdtp_hid_wakeup(cli_data->hid_sensor_hubs[current_index]);
++}
++
++static void amd_sfh_work_buffer(struct work_struct *work)
++{
++	struct amdtp_cl_data *cli_data = container_of(work, struct amdtp_cl_data, work_buffer.work);
++	u8 report_size;
++	int i;
++
++	for (i = 0; i < cli_data->num_hid_devices; i++) {
++		report_size = get_input_report(cli_data->sensor_idx[i], cli_data->report_id[i],
++					       cli_data->input_report[i],
++					       cli_data->sensor_virt_addr[i]);
++		hid_input_report(cli_data->hid_sensor_hubs[i], HID_INPUT_REPORT,
++				 cli_data->input_report[i], report_size, 0);
++	}
++	schedule_delayed_work(&cli_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
++}
++
++int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
++{
++	struct amdtp_cl_data *cl_data = privdata->cl_data;
++	struct amd_mp2_sensor_info info;
++	struct device *dev;
++	u32 feature_report_size;
++	u32 input_report_size;
++	u8 cl_idx;
++	int rc, i;
++
++	dev = &privdata->pdev->dev;
++	cl_data = kzalloc(sizeof(*cl_data), GFP_KERNEL);
++	if (!cl_data)
++		return -ENOMEM;
++
++	cl_data->num_hid_devices = amd_mp2_get_sensor_num(privdata, &cl_data->sensor_idx[0]);
++
++	INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work);
++	INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer);
++	INIT_LIST_HEAD(&req_list.list);
++
++	for (i = 0; i < cl_data->num_hid_devices; i++) {
++		cl_data->sensor_virt_addr[i] = dma_alloc_coherent(dev, sizeof(int) * 8,
++								  &cl_data->sensor_phys_addr[i],
++								  GFP_KERNEL);
++		cl_data->sensor_sts[i] = 0;
++		cl_data->sensor_requested_cnt[i] = 0;
++		cl_data->cur_hid_dev = i;
++		cl_idx = cl_data->sensor_idx[i];
++		cl_data->report_descr_sz[i] = get_descr_sz(cl_idx, descr_size);
++		if (!cl_data->report_descr_sz[i]) {
++			rc = -EINVAL;
++			goto cleanup;
++		}
++		feature_report_size = get_descr_sz(cl_idx, feature_size);
++		if (!feature_report_size) {
++			rc = -EINVAL;
++			goto cleanup;
++		}
++		input_report_size =  get_descr_sz(cl_idx, input_size);
++		if (!input_report_size) {
++			rc = -EINVAL;
++			goto cleanup;
++		}
++		cl_data->feature_report[i] = kzalloc(feature_report_size, GFP_KERNEL);
++		if (!cl_data->feature_report[i]) {
++			rc = -ENOMEM;
++			goto cleanup;
++		}
++		cl_data->input_report[i] = kzalloc(input_report_size, GFP_KERNEL);
++		if (!cl_data->input_report[i]) {
++			rc = -ENOMEM;
++			goto cleanup;
++		}
++		info.period = msecs_to_jiffies(AMD_SFH_IDLE_LOOP);
++		info.sensor_idx = cl_idx;
++		info.phys_address = cl_data->sensor_phys_addr[i];
++
++		cl_data->report_descr[i] = kzalloc(cl_data->report_descr_sz[i], GFP_KERNEL);
++		if (!cl_data->report_descr[i]) {
++			rc = -ENOMEM;
++			goto cleanup;
++		}
++		rc = get_report_descriptor(cl_idx, cl_data->report_descr[i]);
++		if (rc)
++			return rc;
++		rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data);
++		if (rc)
++			return rc;
++		amd_start_sensor(privdata, info);
++		cl_data->sensor_sts[i] = 1;
++	}
++	privdata->cl_data = cl_data;
++	schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
++	return 0;
++
++cleanup:
++	for (i = 0; i < cl_data->num_hid_devices; i++) {
++		if (cl_data->sensor_virt_addr[i]) {
++			dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
++					  cl_data->sensor_virt_addr[i],
++					  cl_data->sensor_phys_addr[i]);
++		}
++		kfree(cl_data->feature_report[i]);
++		kfree(cl_data->input_report[i]);
++		kfree(cl_data->report_descr[i]);
++	}
++	kfree(cl_data);
++	return rc;
++}
++
++int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
++{
++	struct amdtp_cl_data *cl_data = privdata->cl_data;
++	int i;
++
++	for (i = 0; i < cl_data->num_hid_devices; i++)
++		amd_stop_sensor(privdata, i);
++
++	cancel_delayed_work_sync(&cl_data->work);
++	cancel_delayed_work_sync(&cl_data->work_buffer);
++	amdtp_hid_remove(cl_data);
++
++	for (i = 0; i < cl_data->num_hid_devices; i++) {
++		if (cl_data->sensor_virt_addr[i]) {
++			dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
++					  cl_data->sensor_virt_addr[i],
++					  cl_data->sensor_phys_addr[i]);
++		}
++	}
++	kfree(cl_data);
++	return 0;
++}
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_hid.c linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_hid.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_hid.c	2020-12-25 14:25:44.298391979 +0100
+@@ -0,0 +1,174 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ * AMD MP2 Sensors transport driver
++ *
++ * Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
++ *	    Sandeep Singh <sandeep.singh@amd.com>
++ */
++#include <linux/hid.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++
++#include "amd_sfh_hid.h"
++
++#define AMD_SFH_RESPONSE_TIMEOUT	1500
++
++/**
++ * amdtp_hid_parse() - hid-core .parse() callback
++ * @hid:	hid device instance
++ *
++ * This function gets called during call to hid_add_device
++ *
++ * Return: 0 on success and non zero on error
++ */
++static int amdtp_hid_parse(struct hid_device *hid)
++{
++	struct amdtp_hid_data *hid_data = hid->driver_data;
++	struct amdtp_cl_data *cli_data = hid_data->cli_data;
++
++	return hid_parse_report(hid, cli_data->report_descr[hid_data->index],
++			      cli_data->report_descr_sz[hid_data->index]);
++}
++
++/* Empty callbacks with success return code */
++static int amdtp_hid_start(struct hid_device *hid)
++{
++	return 0;
++}
++
++static void amdtp_hid_stop(struct hid_device *hid)
++{
++}
++
++static int amdtp_hid_open(struct hid_device *hid)
++{
++	return 0;
++}
++
++static void amdtp_hid_close(struct hid_device *hid)
++{
++}
++
++static int amdtp_raw_request(struct hid_device *hdev, u8 reportnum,
++			     u8 *buf, size_t len, u8 rtype, int reqtype)
++{
++	return 0;
++}
++
++static void amdtp_hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype)
++{
++	int rc;
++
++	switch (reqtype) {
++	case HID_REQ_GET_REPORT:
++		rc = amd_sfh_get_report(hid, rep->id, rep->type);
++		if (rc)
++			dev_err(&hid->dev, "AMDSFH  get report error\n");
++		break;
++	case HID_REQ_SET_REPORT:
++		amd_sfh_set_report(hid, rep->id, reqtype);
++		break;
++	default:
++		break;
++	}
++}
++
++static int amdtp_wait_for_response(struct hid_device *hid)
++{
++	struct amdtp_hid_data *hid_data =  hid->driver_data;
++	struct amdtp_cl_data *cli_data = hid_data->cli_data;
++	int i, ret = 0;
++
++	for (i = 0; i < cli_data->num_hid_devices; i++) {
++		if (cli_data->hid_sensor_hubs[i] == hid)
++			break;
++	}
++
++	if (!cli_data->request_done[i])
++		ret = wait_event_interruptible_timeout(hid_data->hid_wait,
++						       cli_data->request_done[i],
++						       msecs_to_jiffies(AMD_SFH_RESPONSE_TIMEOUT));
++	if (ret == -ERESTARTSYS)
++		return -ERESTARTSYS;
++	else if (ret < 0)
++		return -ETIMEDOUT;
++	else
++		return 0;
++}
++
++void amdtp_hid_wakeup(struct hid_device *hid)
++{
++	struct amdtp_hid_data *hid_data = hid->driver_data;
++	struct amdtp_cl_data *cli_data = hid_data->cli_data;
++
++	cli_data->request_done[cli_data->cur_hid_dev] = true;
++	wake_up_interruptible(&hid_data->hid_wait);
++}
++
++static struct hid_ll_driver amdtp_hid_ll_driver = {
++	.parse	=	amdtp_hid_parse,
++	.start	=	amdtp_hid_start,
++	.stop	=	amdtp_hid_stop,
++	.open	=	amdtp_hid_open,
++	.close	=	amdtp_hid_close,
++	.request  =	amdtp_hid_request,
++	.wait	=	amdtp_wait_for_response,
++	.raw_request  =	amdtp_raw_request,
++};
++
++int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data)
++{
++	struct hid_device *hid;
++	struct amdtp_hid_data *hid_data;
++	int rc;
++
++	hid = hid_allocate_device();
++	if (IS_ERR(hid))
++		return PTR_ERR(hid);
++
++	hid_data = kzalloc(sizeof(*hid_data), GFP_KERNEL);
++	if (!hid_data) {
++		rc = -ENOMEM;
++		goto err_hid_data;
++	}
++
++	hid->ll_driver = &amdtp_hid_ll_driver;
++	hid_data->index = cur_hid_dev;
++	hid_data->cli_data = cli_data;
++	init_waitqueue_head(&hid_data->hid_wait);
++
++	hid->driver_data = hid_data;
++	cli_data->hid_sensor_hubs[cur_hid_dev] = hid;
++	hid->bus = BUS_AMD_AMDTP;
++	hid->vendor = AMD_SFH_HID_VENDOR;
++	hid->product = AMD_SFH_HID_PRODUCT;
++	snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-amdtp",
++		 hid->vendor, hid->product);
++
++	rc = hid_add_device(hid);
++	if (rc)
++		goto err_hid_device;
++	return 0;
++
++err_hid_device:
++	kfree(hid_data);
++err_hid_data:
++	hid_destroy_device(hid);
++	return rc;
++}
++
++void amdtp_hid_remove(struct amdtp_cl_data *cli_data)
++{
++	int i;
++
++	for (i = 0; i < cli_data->num_hid_devices; ++i) {
++		kfree(cli_data->feature_report[i]);
++		kfree(cli_data->input_report[i]);
++		kfree(cli_data->report_descr[i]);
++		if (cli_data->hid_sensor_hubs[i]) {
++			kfree(cli_data->hid_sensor_hubs[i]->driver_data);
++			hid_destroy_device(cli_data->hid_sensor_hubs[i]);
++			cli_data->hid_sensor_hubs[i] = NULL;
++		}
++	}
++}
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_hid.h linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_hid.h
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_hid.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_hid.h	2020-12-25 14:25:44.299391977 +0100
+@@ -0,0 +1,67 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++/*
++ * AMD MP2 Sensors transport driver
++ *
++ * Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
++ *	    Sandeep Singh <sandeep.singh@amd.com>
++ */
++
++#ifndef AMDSFH_HID_H
++#define AMDSFH_HID_H
++
++#define MAX_HID_DEVICES		4
++#define BUS_AMD_AMDTP		0x20
++#define AMD_SFH_HID_VENDOR	0x1022
++#define AMD_SFH_HID_PRODUCT	0x0001
++
++struct amdtp_cl_data {
++	u8 init_done;
++	u32 cur_hid_dev;
++	u32 hid_dev_count;
++	u32 num_hid_devices;
++	struct device_info *hid_devices;
++	u8  *report_descr[MAX_HID_DEVICES];
++	int report_descr_sz[MAX_HID_DEVICES];
++	struct hid_device *hid_sensor_hubs[MAX_HID_DEVICES];
++	u8 *hid_descr[MAX_HID_DEVICES];
++	int hid_descr_size[MAX_HID_DEVICES];
++	phys_addr_t phys_addr_base;
++	u32 *sensor_virt_addr[MAX_HID_DEVICES];
++	phys_addr_t sensor_phys_addr[MAX_HID_DEVICES];
++	u32 sensor_sts[MAX_HID_DEVICES];
++	u32 sensor_requested_cnt[MAX_HID_DEVICES];
++	u8 report_type[MAX_HID_DEVICES];
++	u8 report_id[MAX_HID_DEVICES];
++	u8 sensor_idx[MAX_HID_DEVICES];
++	u8 *feature_report[MAX_HID_DEVICES];
++	u8 *input_report[MAX_HID_DEVICES];
++	u8 request_done[MAX_HID_DEVICES];
++	struct delayed_work work;
++	struct delayed_work work_buffer;
++};
++
++/**
++ * struct amdtp_hid_data - Per instance HID data
++ * @index:		Device index in the order of enumeration
++ * @request_done:	Get Feature/Input report complete flag
++ *			used during get/set request from hid core
++ * @cli_data:		Link to the client instance
++ * @hid_wait:		Completion waitq
++ *
++ * Used to tie hid->driver data to driver client instance
++ */
++struct amdtp_hid_data {
++	int index;
++	struct amdtp_cl_data *cli_data;
++	wait_queue_head_t hid_wait;
++};
++
++/* Interface functions between HID LL driver and AMD SFH client */
++void hid_amdtp_set_feature(struct hid_device *hid, char *buf, u32 len, int report_id);
++void hid_amdtp_get_report(struct hid_device *hid, int report_id, int report_type);
++int amdtp_hid_probe(u32 cur_hid_dev, struct amdtp_cl_data *cli_data);
++void amdtp_hid_remove(struct amdtp_cl_data *cli_data);
++int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type);
++void amd_sfh_set_report(struct hid_device *hid, int report_id, int report_type);
++void amdtp_hid_wakeup(struct hid_device *hid);
++#endif
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c	2020-12-25 14:25:44.299391977 +0100
+@@ -0,0 +1,152 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ * AMD MP2 PCIe communication driver
++ * Copyright 2020 Advanced Micro Devices, Inc.
++ *
++ * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
++ *	    Sandeep Singh <Sandeep.singh@amd.com>
++ */
++
++#include <linux/bitops.h>
++#include <linux/delay.h>
++#include <linux/dma-mapping.h>
++#include <linux/interrupt.h>
++#include <linux/io-64-nonatomic-lo-hi.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++
++#include "amd_sfh_pcie.h"
++
++#define DRIVER_NAME	"pcie_mp2_amd"
++#define DRIVER_DESC	"AMD(R) PCIe MP2 Communication Driver"
++
++#define ACEL_EN		BIT(0)
++#define GYRO_EN		BIT(1)
++#define MAGNO_EN		BIT(2)
++#define ALS_EN		BIT(19)
++
++void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info)
++{
++	union sfh_cmd_param cmd_param;
++	union sfh_cmd_base cmd_base;
++
++	/* fill up command register */
++	memset(&cmd_base, 0, sizeof(cmd_base));
++	cmd_base.s.cmd_id = ENABLE_SENSOR;
++	cmd_base.s.period = info.period;
++	cmd_base.s.sensor_id = info.sensor_idx;
++
++	/* fill up command param register */
++	memset(&cmd_param, 0, sizeof(cmd_param));
++	cmd_param.s.buf_layout = 1;
++	cmd_param.s.buf_length = 16;
++
++	writeq(info.phys_address, privdata->mmio + AMD_C2P_MSG2);
++	writel(cmd_param.ul, privdata->mmio + AMD_C2P_MSG1);
++	writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
++}
++
++void amd_stop_sensor(struct amd_mp2_dev *privdata, u16 sensor_idx)
++{
++	union sfh_cmd_base cmd_base;
++
++	/* fill up command register */
++	memset(&cmd_base, 0, sizeof(cmd_base));
++	cmd_base.s.cmd_id = DISABLE_SENSOR;
++	cmd_base.s.period = 0;
++	cmd_base.s.sensor_id = sensor_idx;
++
++	writeq(0x0, privdata->mmio + AMD_C2P_MSG2);
++	writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
++}
++
++void amd_stop_all_sensors(struct amd_mp2_dev *privdata)
++{
++	union sfh_cmd_base cmd_base;
++
++	/* fill up command register */
++	memset(&cmd_base, 0, sizeof(cmd_base));
++	cmd_base.s.cmd_id = STOP_ALL_SENSORS;
++	cmd_base.s.period = 0;
++	cmd_base.s.sensor_id = 0;
++
++	writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
++}
++
++int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id)
++{
++	int activestatus, num_of_sensors = 0;
++
++	privdata->activecontrolstatus = readl(privdata->mmio + AMD_P2C_MSG3);
++	activestatus = privdata->activecontrolstatus >> 4;
++	if (ACEL_EN  & activestatus)
++		sensor_id[num_of_sensors++] = accel_idx;
++
++	if (GYRO_EN & activestatus)
++		sensor_id[num_of_sensors++] = gyro_idx;
++
++	if (MAGNO_EN & activestatus)
++		sensor_id[num_of_sensors++] = mag_idx;
++
++	if (ALS_EN & activestatus)
++		sensor_id[num_of_sensors++] = als_idx;
++
++	return num_of_sensors;
++}
++
++static void amd_mp2_pci_remove(void *privdata)
++{
++	amd_sfh_hid_client_deinit(privdata);
++	amd_stop_all_sensors(privdata);
++}
++
++static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
++{
++	struct amd_mp2_dev *privdata;
++	int rc;
++
++	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
++	if (!privdata)
++		return -ENOMEM;
++
++	privdata->pdev = pdev;
++	pci_set_drvdata(pdev, privdata);
++	rc = pcim_enable_device(pdev);
++	if (rc)
++		return rc;
++
++	rc = pcim_iomap_regions(pdev, BIT(2), DRIVER_NAME);
++	if (rc)
++		return rc;
++
++	privdata->mmio = pcim_iomap_table(pdev)[2];
++	pci_set_master(pdev);
++	rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
++	if (rc) {
++		rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++		return rc;
++	}
++	rc = devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
++	if (rc)
++		return rc;
++
++	return amd_sfh_hid_client_init(privdata);
++}
++
++static const struct pci_device_id amd_mp2_pci_tbl[] = {
++	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_MP2) },
++	{ }
++};
++MODULE_DEVICE_TABLE(pci, amd_mp2_pci_tbl);
++
++static struct pci_driver amd_mp2_pci_driver = {
++	.name		= DRIVER_NAME,
++	.id_table	= amd_mp2_pci_tbl,
++	.probe		= amd_mp2_pci_probe,
++};
++module_pci_driver(amd_mp2_pci_driver);
++
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>");
++MODULE_AUTHOR("Sandeep Singh <Sandeep.singh@amd.com>");
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/amd_sfh_pcie.h	2020-12-25 14:25:44.299391977 +0100
+@@ -0,0 +1,79 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++/*
++ * AMD MP2 PCIe communication driver
++ * Copyright 2020 Advanced Micro Devices, Inc.
++ * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
++ *	    Sandeep Singh <Sandeep.singh@amd.com>
++ */
++
++#ifndef PCIE_MP2_AMD_H
++#define PCIE_MP2_AMD_H
++
++#include <linux/pci.h>
++
++#define PCI_DEVICE_ID_AMD_MP2	0x15E4
++
++#define ENABLE_SENSOR		1
++#define DISABLE_SENSOR		2
++#define STOP_ALL_SENSORS	8
++
++/* MP2 C2P Message Registers */
++#define AMD_C2P_MSG0	0x10500
++#define AMD_C2P_MSG1	0x10504
++#define AMD_C2P_MSG2	0x10508
++
++/* MP2 P2C Message Registers */
++#define AMD_P2C_MSG3	0x1068C /* Supported Sensors info */
++
++/* SFH Command register */
++union sfh_cmd_base {
++	u32 ul;
++	struct {
++		u32 cmd_id : 8;
++		u32 sensor_id : 8;
++		u32 period : 16;
++	} s;
++};
++
++union sfh_cmd_param {
++	u32 ul;
++	struct {
++		u32 buf_layout : 2;
++		u32 buf_length : 6;
++		u32 rsvd : 24;
++	} s;
++};
++
++struct sfh_cmd_reg {
++	union sfh_cmd_base cmd_base;
++	union sfh_cmd_param cmd_param;
++	phys_addr_t phys_addr;
++};
++
++enum sensor_idx {
++	accel_idx = 0,
++	gyro_idx = 1,
++	mag_idx = 2,
++	als_idx = 19
++};
++
++struct amd_mp2_dev {
++	struct pci_dev *pdev;
++	struct amdtp_cl_data *cl_data;
++	void __iomem *mmio;
++	u32 activecontrolstatus;
++};
++
++struct amd_mp2_sensor_info {
++	u8 sensor_idx;
++	u32 period;
++	phys_addr_t phys_address;
++};
++
++void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info);
++void amd_stop_sensor(struct amd_mp2_dev *privdata, u16 sensor_idx);
++void amd_stop_all_sensors(struct amd_mp2_dev *privdata);
++int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id);
++int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata);
++int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata);
++#endif
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c linux-5.10.2-amd/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c	2020-12-25 14:25:44.299391977 +0100
+@@ -0,0 +1,224 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ *  AMD SFH Report Descriptor generator
++ *  Copyright 2020 Advanced Micro Devices, Inc.
++ *  Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
++ *	     Sandeep Singh <sandeep.singh@amd.com>
++ */
++
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <linux/slab.h>
++#include "amd_sfh_pcie.h"
++#include "amd_sfh_hid_desc.h"
++#include "amd_sfh_hid_report_desc.h"
++
++#define	AMD_SFH_FW_MULTIPLIER (1000)
++#define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM	0x41
++#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM	0x51
++#define HID_DEFAULT_REPORT_INTERVAL				0x50
++#define HID_DEFAULT_MIN_VALUE					0X7F
++#define HID_DEFAULT_MAX_VALUE					0x80
++#define HID_DEFAULT_SENSITIVITY					0x7F
++#define HID_USAGE_SENSOR_PROPERTY_CONNECTION_TYPE_PC_INTEGRATED_ENUM  0x01
++/* state enums */
++#define HID_USAGE_SENSOR_STATE_READY_ENUM                             0x02
++#define HID_USAGE_SENSOR_STATE_INITIALIZING_ENUM                      0x05
++#define HID_USAGE_SENSOR_EVENT_DATA_UPDATED_ENUM                      0x04
++
++int get_report_descriptor(int sensor_idx, u8 *rep_desc)
++{
++	switch (sensor_idx) {
++	case accel_idx: /* accel */
++		memset(rep_desc, 0, sizeof(accel3_report_descriptor));
++		memcpy(rep_desc, accel3_report_descriptor,
++		       sizeof(accel3_report_descriptor));
++		break;
++	case gyro_idx: /* gyro */
++		memset(rep_desc, 0, sizeof(gyro3_report_descriptor));
++		memcpy(rep_desc, gyro3_report_descriptor,
++		       sizeof(gyro3_report_descriptor));
++		break;
++	case mag_idx: /* Magnetometer */
++		memset(rep_desc, 0, sizeof(comp3_report_descriptor));
++		memcpy(rep_desc, comp3_report_descriptor,
++		       sizeof(comp3_report_descriptor));
++		break;
++	case als_idx: /* ambient light sensor */
++		memset(rep_desc, 0, sizeof(als_report_descriptor));
++		memcpy(rep_desc, als_report_descriptor,
++		       sizeof(als_report_descriptor));
++		break;
++	default:
++		break;
++	}
++	return 0;
++}
++
++u32 get_descr_sz(int sensor_idx, int descriptor_name)
++{
++	switch (sensor_idx) {
++	case accel_idx:
++		switch (descriptor_name) {
++		case descr_size:
++			return sizeof(accel3_report_descriptor);
++		case input_size:
++			return sizeof(struct accel3_input_report);
++		case feature_size:
++			return sizeof(struct accel3_feature_report);
++		}
++		break;
++	case gyro_idx:
++		switch (descriptor_name) {
++		case descr_size:
++			return sizeof(gyro3_report_descriptor);
++		case input_size:
++			return sizeof(struct gyro_input_report);
++		case feature_size:
++			return sizeof(struct gyro_feature_report);
++		}
++		break;
++	case mag_idx:
++		switch (descriptor_name) {
++		case descr_size:
++			return sizeof(comp3_report_descriptor);
++		case input_size:
++			return sizeof(struct magno_input_report);
++		case feature_size:
++			return sizeof(struct magno_feature_report);
++		}
++		break;
++	case als_idx:
++		switch (descriptor_name) {
++		case descr_size:
++			return sizeof(als_report_descriptor);
++		case input_size:
++			return sizeof(struct als_input_report);
++		case feature_size:
++			return sizeof(struct als_feature_report);
++		}
++		break;
++	default:
++		break;
++	}
++	return 0;
++}
++
++static void get_common_features(struct common_feature_property *common, int report_id)
++{
++	common->report_id = report_id;
++	common->connection_type = HID_USAGE_SENSOR_PROPERTY_CONNECTION_TYPE_PC_INTEGRATED_ENUM;
++	common->report_state = HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM;
++	common->power_state = HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM;
++	common->sensor_state = HID_USAGE_SENSOR_STATE_INITIALIZING_ENUM;
++	common->report_interval =  HID_DEFAULT_REPORT_INTERVAL;
++}
++
++u8 get_feature_report(int sensor_idx, int report_id, u8 *feature_report)
++{
++	struct accel3_feature_report acc_feature;
++	struct gyro_feature_report gyro_feature;
++	struct magno_feature_report magno_feature;
++	struct als_feature_report als_feature;
++	u8 report_size = 0;
++
++	if (!feature_report)
++		return report_size;
++
++	switch (sensor_idx) {
++	case accel_idx: /* accel */
++		get_common_features(&acc_feature.common_property, report_id);
++		acc_feature.accel_change_sesnitivity = HID_DEFAULT_SENSITIVITY;
++		acc_feature.accel_sensitivity_min = HID_DEFAULT_MIN_VALUE;
++		acc_feature.accel_sensitivity_max = HID_DEFAULT_MAX_VALUE;
++		memcpy(feature_report, &acc_feature, sizeof(acc_feature));
++		report_size = sizeof(acc_feature);
++		break;
++	case gyro_idx: /* gyro */
++		get_common_features(&gyro_feature.common_property, report_id);
++		gyro_feature.gyro_change_sesnitivity = HID_DEFAULT_SENSITIVITY;
++		gyro_feature.gyro_sensitivity_min = HID_DEFAULT_MIN_VALUE;
++		gyro_feature.gyro_sensitivity_max = HID_DEFAULT_MAX_VALUE;
++		memcpy(feature_report, &gyro_feature, sizeof(gyro_feature));
++		report_size = sizeof(gyro_feature);
++		break;
++	case mag_idx: /* Magnetometer */
++		get_common_features(&magno_feature.common_property, report_id);
++		magno_feature.magno_headingchange_sensitivity = HID_DEFAULT_SENSITIVITY;
++		magno_feature.heading_min = HID_DEFAULT_MIN_VALUE;
++		magno_feature.heading_max = HID_DEFAULT_MAX_VALUE;
++		magno_feature.flux_change_sensitivity = HID_DEFAULT_MIN_VALUE;
++		magno_feature.flux_min = HID_DEFAULT_MIN_VALUE;
++		magno_feature.flux_max = HID_DEFAULT_MAX_VALUE;
++		memcpy(feature_report, &magno_feature, sizeof(magno_feature));
++		report_size = sizeof(magno_feature);
++		break;
++	case als_idx:  /* ambient light sensor */
++		get_common_features(&als_feature.common_property, report_id);
++		als_feature.als_change_sesnitivity = HID_DEFAULT_SENSITIVITY;
++		als_feature.als_sensitivity_min = HID_DEFAULT_MIN_VALUE;
++		als_feature.als_sensitivity_max = HID_DEFAULT_MAX_VALUE;
++		memcpy(feature_report, &als_feature, sizeof(als_feature));
++		report_size = sizeof(als_feature);
++		break;
++	default:
++		break;
++	}
++	return report_size;
++}
++
++static void get_common_inputs(struct common_input_property *common, int report_id)
++{
++	common->report_id = report_id;
++	common->sensor_state = HID_USAGE_SENSOR_STATE_READY_ENUM;
++	common->event_type = HID_USAGE_SENSOR_EVENT_DATA_UPDATED_ENUM;
++}
++
++u8 get_input_report(int sensor_idx, int report_id, u8 *input_report, u32 *sensor_virt_addr)
++{
++	struct accel3_input_report acc_input;
++	struct gyro_input_report gyro_input;
++	struct magno_input_report magno_input;
++	struct als_input_report als_input;
++	u8 report_size = 0;
++
++	if (!sensor_virt_addr || !input_report)
++		return report_size;
++
++	switch (sensor_idx) {
++	case accel_idx: /* accel */
++		get_common_inputs(&acc_input.common_property, report_id);
++		acc_input.in_accel_x_value = (int)sensor_virt_addr[0] / AMD_SFH_FW_MULTIPLIER;
++		acc_input.in_accel_y_value = (int)sensor_virt_addr[1] / AMD_SFH_FW_MULTIPLIER;
++		acc_input.in_accel_z_value =  (int)sensor_virt_addr[2] / AMD_SFH_FW_MULTIPLIER;
++		memcpy(input_report, &acc_input, sizeof(acc_input));
++		report_size = sizeof(acc_input);
++		break;
++	case gyro_idx: /* gyro */
++		get_common_inputs(&gyro_input.common_property, report_id);
++		gyro_input.in_angel_x_value = (int)sensor_virt_addr[0] / AMD_SFH_FW_MULTIPLIER;
++		gyro_input.in_angel_y_value = (int)sensor_virt_addr[1] / AMD_SFH_FW_MULTIPLIER;
++		gyro_input.in_angel_z_value =  (int)sensor_virt_addr[2] / AMD_SFH_FW_MULTIPLIER;
++		memcpy(input_report, &gyro_input, sizeof(gyro_input));
++		report_size = sizeof(gyro_input);
++		break;
++	case mag_idx: /* Magnetometer */
++		get_common_inputs(&magno_input.common_property, report_id);
++		magno_input.in_magno_x = (int)sensor_virt_addr[0] / AMD_SFH_FW_MULTIPLIER;
++		magno_input.in_magno_y = (int)sensor_virt_addr[1] / AMD_SFH_FW_MULTIPLIER;
++		magno_input.in_magno_z = (int)sensor_virt_addr[2] / AMD_SFH_FW_MULTIPLIER;
++		magno_input.in_magno_accuracy = (u16)sensor_virt_addr[3] / AMD_SFH_FW_MULTIPLIER;
++		memcpy(input_report, &magno_input, sizeof(magno_input));
++		report_size = sizeof(magno_input);
++		break;
++	case als_idx: /* Als */
++		get_common_inputs(&als_input.common_property, report_id);
++		als_input.illuminance_value =  (int)sensor_virt_addr[0] / AMD_SFH_FW_MULTIPLIER;
++		report_size = sizeof(als_input);
++		memcpy(input_report, &als_input, sizeof(als_input));
++		break;
++	default:
++		break;
++	}
++	return report_size;
++}
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h linux-5.10.2-amd/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h	2020-12-25 14:25:44.299391977 +0100
+@@ -0,0 +1,107 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++/*
++ * HID report descriptors, structures and routines
++ * Copyright 2020 Advanced Micro Devices, Inc.
++ * Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
++ *	    Sandeep Singh <Sandeep.singh@amd.com>
++ */
++
++#ifndef AMD_SFH_HID_DESCRIPTOR_H
++#define AMD_SFH_HID_DESCRIPTOR_H
++
++enum desc_type {
++	/* Report descriptor name */
++	descr_size = 1,
++	input_size,
++	feature_size,
++};
++
++struct common_feature_property {
++	/* common properties */
++	u8 report_id;
++	u8 connection_type;
++	u8 report_state;
++	u8 power_state;
++	u8 sensor_state;
++	u32 report_interval;
++} __packed;
++
++struct common_input_property {
++	/* common properties */
++	u8 report_id;
++	u8 sensor_state;
++	u8 event_type;
++} __packed;
++
++struct accel3_feature_report {
++	struct common_feature_property common_property;
++	/* properties specific to this sensor */
++	u16 accel_change_sesnitivity;
++	s16 accel_sensitivity_max;
++	s16 accel_sensitivity_min;
++} __packed;
++
++struct accel3_input_report {
++	struct	common_input_property common_property;
++	/* values specific to this sensor */
++	int in_accel_x_value;
++	int in_accel_y_value;
++	int in_accel_z_value;
++	/* include if required to support the "shake" event */
++	u8 in_accel_shake_detection;
++} __packed;
++
++struct gyro_feature_report {
++	struct common_feature_property common_property;
++	/* properties specific to this sensor */
++	u16 gyro_change_sesnitivity;
++	s16 gyro_sensitivity_max;
++	s16 gyro_sensitivity_min;
++} __packed;
++
++struct gyro_input_report {
++	struct	common_input_property common_property;
++	/* values specific to this sensor */
++	int in_angel_x_value;
++	int in_angel_y_value;
++	int in_angel_z_value;
++} __packed;
++
++struct magno_feature_report {
++	struct common_feature_property common_property;
++	/*properties specific to this sensor */
++	u16 magno_headingchange_sensitivity;
++	s16 heading_min;
++	s16 heading_max;
++	u16 flux_change_sensitivity;
++	s16 flux_min;
++	s16 flux_max;
++} __packed;
++
++struct magno_input_report {
++	struct	common_input_property common_property;
++	int in_magno_x;
++	int in_magno_y;
++	int in_magno_z;
++	int in_magno_accuracy;
++} __packed;
++
++struct als_feature_report {
++	struct common_feature_property common_property;
++	/* properties specific to this sensor */
++	u16 als_change_sesnitivity;
++	s16 als_sensitivity_max;
++	s16 als_sensitivity_min;
++} __packed;
++
++struct als_input_report {
++	struct common_input_property common_property;
++	/* values specific to this sensor */
++	int illuminance_value;
++} __packed;
++
++int get_report_descriptor(int sensor_idx, u8 rep_desc[]);
++u32 get_descr_sz(int sensor_idx, int descriptor_name);
++u8 get_feature_report(int sensor_idx, int report_id, u8 *feature_report);
++u8 get_input_report(int sensor_idx, int report_id, u8 *input_report, u32 *sensor_virt_addr);
++#endif
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h linux-5.10.2-amd/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h	2020-12-25 14:25:44.299391977 +0100
+@@ -0,0 +1,645 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++/*
++ * HID  descriptor stuructures
++ * Copyright 2020 Advanced Micro Devices, Inc.
++ * Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
++ *	    Sandeep Singh <Sandeep.singh@amd.com>
++ */
++
++#ifndef AMD_SFH_HID_REPORT_DESCRIPTOR_H
++#define AMD_SFH_HID_REPORT_DESCRIPTOR_H
++
++// Accelerometer 3D Sensor
++static const u8 accel3_report_descriptor[] = {
++0x05, 0x20,          /* Usage page */
++0x09, 0x73,          /* Motion type Accel 3D */
++0xA1, 0x00,          /* HID Collection (Physical) */
++
++//feature reports(xmit/receive)
++0x85, 1,           /* HID  Report ID */
++0x05, 0x20,	   /* HID usage page sensor */
++0x0A, 0x09, 0x03,  /* Sensor property and sensor connection type */
++0x15, 0,           /* HID logical MIN_8(0) */
++0x25, 2,	   /* HID logical MAX_8(2) */
++0x75, 8,	   /* HID report size(8) */
++0x95, 1,	   /* HID report count(1) */
++0xA1, 0x02,	   /* HID collection (logical) */
++0x0A, 0x30, 0x08, /* Sensor property connection type intergated sel*/
++0x0A, 0x31, 0x08, /* Sensor property connection type attached sel */
++0x0A, 0x32, 0x08, /* Sensor property connection type external sel */
++0xB1, 0x00,       /* HID feature (Data_Arr_Abs) */
++0xC0,		  /* HID end collection */
++0x0A, 0x16, 0x03, /* HID usage sensor property reporting state */
++0x15, 0,          /* HID logical Min_8(0) */
++0x25, 5,	  /* HID logical Max_8(5) */
++0x75, 8,	  /* HID report size(8) */
++0x95, 1,          /* HID report count(1) */
++0xA1, 0x02,	  /* HID collection(logical) */
++0x0A, 0x40, 0x08, /* Sensor property report state no events sel */
++0x0A, 0x41, 0x08, /* Sensor property report state all events sel */
++0x0A, 0x42, 0x08, /* Sensor property report state threshold events sel */
++0x0A, 0x43, 0x08, /* Sensor property report state no events wake sel */
++0x0A, 0x44, 0x08, /* Sensor property report state all events wake sel */
++0x0A, 0x45, 0x08, /* Sensor property report state threshold events wake sel */
++0xB1, 0x00,	  /* HID feature (Data_Arr_Abs) */
++0xC0,		  /* HID end collection */
++0x0A, 0x19, 0x03, /* HID usage sensor property power state */
++0x15, 0,	  /* HID logical Min_8(0) */
++0x25, 5,	  /* HID logical Max_8(5) */
++0x75, 8,	  /* HID report size(8) */
++0x95, 1,	  /* HID report count(1) */
++0xA1, 0x02,	  /* HID collection(logical) */
++0x0A, 0x50, 0x08, /* Sensor property power state undefined sel */
++0x0A, 0x51, 0x08, /* Sensor property power state D0 full power  sel */
++0x0A, 0x52, 0x08, /* Sensor property power state D1 low power sel */
++0x0A, 0x53, 0x08, /* Sensor property power state D2 standby with wake sel */
++0x0A, 0x54, 0x08, /* Sensor property power state D3 sleep with wake  sel */
++0x0A, 0x55, 0x08, /* Sensor property power state D4 power off sel */
++0xB1, 0x00,       /* HID feature (Data_Arr_Abs) */
++0xC0,		  /* HID end collection */
++0x0A, 0x01, 0x02, /* HID usage sensor state */
++0x15, 0,	  /* HID logical Min_8(0) */
++0x25, 6,	  /* HID logical Max_8(6) */
++0x75, 8,	  /* HID report size(8) */
++0x95, 1,	  /* HID report count(1) */
++0xA1, 0x02,	  /* HID collection(logical) */
++0x0A, 0x00, 0x08, /* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08, /* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08, /* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08, /* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08, /* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08, /* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08, /* HID usage sensor state error sel */
++0xB1, 0x00,	  /* HID feature (Data_Arr_Abs) */
++0xC0,		  /* HID end collection */
++0x0A, 0x0E, 0x03, /* HID usage sensor property report interval */
++0x15, 0,	  /* HID logical Min_8(0) */
++0x27, 0xFF, 0xFF, 0xFF, 0xFF, /* HID logical Max_32 */
++
++0x75, 32,	  /* HID report size(32) */
++0x95, 1,	  /* HID report count(1) */
++0x55, 0,	  /* HID unit exponent(0) */
++0xB1, 0x02,	  /* HID feature (Data_Arr_Abs) */
++0x0A, 0x52, 0x14, /* Sensor data motion accel and mod change sensitivity ABS) */
++
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0xFF, 0xFF,	/* HID logical Max_16(0xFF,0xFF) */
++
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x52, 0x24,	/* HID usage sensor data (motion accel and mod max) */
++
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x52, 0x34,	/* HID usage sensor data (motion accel and mod min) */
++
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++
++//input report (transmit)
++0x05, 0x20,		 /* HID usage page sensors */
++0x0A, 0x01, 0x02,	 /* HID usage sensor state */
++0x15, 0,		 /* HID logical Min_8(0) */
++0x25, 6,		 /* HID logical Max_8(6) */
++0x75, 8,		 /* HID report size(8) */
++0x95, 1,		 /* HID report count (1) */
++0xA1, 0x02,		 /* HID end collection (logical) */
++0x0A, 0x00, 0x08,	 /* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,	 /* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,	 /* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,	 /* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,	 /* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,	 /* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,	 /* HID usage sensor state error sel */
++0X81, 0x00,		 /* HID Input (Data_Arr_Abs) */
++0xC0,			 /* HID end collection */
++0x0A, 0x02, 0x02,	 /* HID usage sensor event */
++0x15, 0,		 /* HID logical Min_8(0) */
++0x25, 5,		 /* HID logical Max_8(5) */
++0x75, 8,		 /* HID report size(8) */
++0x95, 1,		 /* HID report count (1) */
++0xA1, 0x02,		 /* HID end collection (logical) */
++0x0A, 0x10, 0x08,	 /* HID usage sensor event unknown sel */
++0x0A, 0x11, 0x08,	 /* HID usage sensor event state changed sel */
++0x0A, 0x12, 0x08,	 /* HID usage sensor event property changed sel */
++0x0A, 0x13, 0x08,	 /* HID usage sensor event data updated sel */
++0x0A, 0x14, 0x08,	 /* HID usage sensor event poll response sel */
++0x0A, 0x15, 0x08,	 /* HID usage sensor event change sensitivity sel */
++0X81, 0x00,		 /* HID Input (Data_Arr_Abs) */
++0xC0,			 /* HID end collection */
++0x0A, 0x53, 0x04,	 /* HID usage sensor data motion Acceleration X axis */
++0x17, 0x00, 0x00, 0x01, 0x80, /* HID logical Min_32 */
++
++0x27, 0xFF, 0xff, 0XFF, 0XFF, /* HID logical Max_32  */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0x0A, 0x54, 0x04,	/* HID usage sensor data motion Acceleration Y axis */
++0x17, 0X00, 0X00, 0x01, 0x80, /* HID logical Min_32 */
++
++0x27, 0xFF, 0xFF, 0XFF, 0XFF, /* HID logical Max_32 */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0x0A, 0x55, 0x04,	/* HID usage sensor data motion Acceleration Z axis */
++0x17, 0X00, 0X00, 0x01, 0x80, /* HID logical Min_32 */
++
++0x27, 0XFF, 0XFF, 0xFF, 0x7F, /* HID logical Max_32 */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++
++0x0A, 0x51, 0x04,	/* HID usage sensor data motion state */
++0x15, 0,		/* HID logical Min_8(0) False = Still*/
++0x25, 1,		/* HID logical Min_8(1) True = In motion */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0xC0			/* HID end collection */
++};
++
++const u8 gyro3_report_descriptor[] = {
++0x05, 0x20,		/* Usage page */
++0x09, 0x76,		/* Motion type Gyro3D */
++0xA1, 0x00,		/* HID Collection (Physical) */
++
++0x85, 2,		/* HID  Report ID */
++0x05, 0x20,		/* HID usage page sensor */
++0x0A, 0x09, 0x03,	/* Sensor property and sensor connection type */
++0x15, 0,		/* HID logical MIN_8(0) */
++0x25, 2,		/* HID logical MAX_8(2) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection (logical) */
++0x0A, 0x30, 0x08,	/* Sensor property connection type intergated sel */
++0x0A, 0x31, 0x08,	/* Sensor property connection type attached sel */
++0x0A, 0x32, 0x08,	/* Sensor property connection type external sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x16, 0x03,	/* HID usage sensor property reporting state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x40, 0x08,	/* Sensor reporting state no events sel */
++0x0A, 0x41, 0x08,	/* Sensor reporting state all events sel */
++0x0A, 0x42, 0x08,	/* Sensor reporting state threshold events sel */
++0x0A, 0x43, 0x08,	/* Sensor reporting state no events wake sel */
++0x0A, 0x44, 0x08,	/* Sensor reporting state all events wake sel */
++0x0A, 0x45, 0x08,	/* Sensor reporting state threshold events wake sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x19, 0x03,	/* HID usage sensor property power state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x50, 0x08,	/* Sensor  power state undefined sel */
++0x0A, 0x51, 0x08,	/* Sensor  power state D0 full power  sel */
++0x0A, 0x52, 0x08,	/* Sensor  power state D1 low power sel */
++0x0A, 0x53, 0x08,	/* Sensor  power state D2 standby with wake sel */
++0x0A, 0x54, 0x08,	/* Sensor  power state D3 sleep with wake  sel */
++0x0A, 0x55, 0x08,	/* Sensor  power state D4 power off sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x01, 0x02,	/* HID usage sensor state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 6,		/* HID logical Max_8(6) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x00, 0x08,	/* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,	/* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,	/* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,	/* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,	/* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,	/* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,	/* HID usage sensor state error sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x0E, 0x03,	/* HID usage sensor property report interval */
++0x15, 0,		/* HID logical Min_8(0) */
++0x27, 0xFF, 0xFF, 0xFF, 0xFF,	/* HID logical Max_32 */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0,		/* HID unit exponent(0) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x56, 0x14,	/* Angular velocity and mod change sensitivity ABS)*/
++
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0xFF, 0xFF,	/* HID logical Max_16(0xFF,0xFF) */
++
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x56, 0x24,	/* Sensor data (motion angular velocity and mod max) */
++
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x56, 0x34,	/* HID usage sensor data (motion accel and mod min) */
++
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++
++//Input reports(transmit)
++0x05, 0x20,		/* HID usage page sensors */
++0x0A, 0x01, 0x02,	/* HID usage sensor state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 6,		/* HID logical Max_8(6) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0xA1, 0x02,		/* HID end collection (logical) */
++0x0A, 0x00, 0x08,	/* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,	/* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,	/* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,	/* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,	/* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,	/* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,	/* HID usage sensor state error sel */
++0X81, 0x00,		/* HID Input (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x02, 0x02,	/* HID usage sensor event */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0xA1, 0x02,		/* HID end collection (logical) */
++0x0A, 0x10, 0x08,	/* HID usage sensor event unknown sel */
++0x0A, 0x11, 0x08,	/* HID usage sensor event state changed sel */
++0x0A, 0x12, 0x08,	/* HID usage sensor event property changed sel */
++0x0A, 0x13, 0x08,	/* HID usage sensor event data updated sel */
++0x0A, 0x14, 0x08,	/* HID usage sensor event poll response sel */
++0x0A, 0x15, 0x08,	/* HID usage sensor event change sensitivity sel */
++0X81, 0x00,		/* HID Input (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x57, 0x04,	/* Sensor data motion Angular velocity  X axis */
++0x17, 0x00, 0x00, 0x01, 0x80,	/* HID logical Min_32 */
++
++0x27, 0xFF, 0xFF, 0xFF, 0x7F,	/* HID logical Max_32 */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0x0A, 0x58, 0x04,	/* Sensor data motion Angular velocity  Y axis */
++0x17, 0x00, 0x00, 0x01, 0x80, /* HID logical Min_32 */
++
++0x27, 0xFF, 0xFF, 0xFF, 0x7F, /* HID logical Max_32 */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0x0A, 0x59, 0x04,	/* Sensor data motion Angular velocity  Z axis */
++0x17, 0x00, 0x00, 0x01, 0x80, /* HID logical Min_32 */
++
++0x27, 0xFF, 0xFF, 0xFF, 0x7F, /* HID logical Max_32 */
++
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++
++0xC0,			/* HID end collection */
++};
++
++const u8 comp3_report_descriptor[] = {
++0x05, 0x20,		/* Usage page */
++0x09, 0x83,		/* Motion type Orientation compass 3D */
++0xA1, 0x00,		/* HID Collection (Physical) */
++
++0x85, 3,		/* HID  Report ID */
++0x05, 0x20,		/* HID usage page sensor */
++0x0A, 0x09, 0x03,	/* Sensor property and sensor connection type */
++0x15, 0,		/* HID logical MIN_8(0) */
++0x25, 2,		/* HID logical MAX_8(2) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection (logical) */
++0x0A, 0x30, 0x08,	/* Sensor property connection type intergated sel */
++0x0A, 0x31, 0x08,	/* Sensor property connection type attached sel */
++0x0A, 0x32, 0x08,	/* Sensor property connection type external sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x16, 0x03,	/* HID usage sensor property reporting state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x40, 0x08,	/* Sensor reporting state no events sel */
++0x0A, 0x41, 0x08,	/* Sensor reporting state all events sel */
++0x0A, 0x42, 0x08,	/* Sensor reporting state threshold events sel */
++0x0A, 0x43, 0x08,	/* Sensor reporting state no events wake sel */
++0x0A, 0x44, 0x08,	/* Sensor reporting state all events wake sel */
++0x0A, 0x45, 0x08,	/* Sensor reporting state threshold events wake sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x19, 0x03,       /* HID usage sensor property power state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x50, 0x08,	/* Sensor power state undefined sel */
++0x0A, 0x51, 0x08,	/* Sensor power state D0 full power  sel */
++0x0A, 0x52, 0x08,	/* Sensor power state D1 low power sel */
++0x0A, 0x53, 0x08,	/* Sensor power state D2 standby with wake sel */
++0x0A, 0x54, 0x08,	/* Sensor power state D3 sleep with wake  sel */
++0x0A, 0x55, 0x08,	/* Sensor power state D4 power off sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x01, 0x02,	/* HID usage sensor state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 6,		/* HID logical Max_8(6) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x00, 0x08,       /* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,       /* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,       /* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,       /* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,       /* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,       /* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,       /* HID usage sensor state error sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x0E, 0x03,	/* HID usage sensor property report interval */
++0x15, 0,		/* HID logical Min_8(0) */
++0x27, 0xFF, 0xFF, 0xFF, 0xFF,	/* HID logical Max_32 */
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0,		/* HID unit exponent(0) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x71, 0x14,	/* Orientation  and mod change sensitivity ABS)*/
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0xFF, 0xFF,	/* HID logical Max_16(0xFF,0xFF) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x71, 0x24,	/* Sensor data (motion orientation  and mod max) */
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x71, 0x34,	/* Sensor data (motion orientation  and mod min) */
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x84, 0x14,	/* Maganetic flux and change sensitivity ABS) */
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0xFF, 0xFF,	/* HID logical Max_16(0xFF,0xFF) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x84, 0x24,	/* Maganetic flux and mod change sensitivity Max) */
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0x84, 0x34,	/* Maganetic flux and mod change sensitivity Min */
++0x16, 0x01, 0x80,	/* HID logical Min_16(0x01,0x80) */
++0x26, 0xFF, 0x7F,	/* HID logical Max_16(0xFF,0x7F) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++
++//Input reports(transmit)
++0x05, 0x20,		/* HID usage page sensors */
++0x0A, 0x01, 0x02,	/* HID usage sensor state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 6,		/* HID logical Max_8(6) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0xA1, 0x02,		/* HID end collection (logical) */
++0x0A, 0x00, 0x08,	/* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,	/* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,	/* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,	/* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,	/* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,	/* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,	/* HID usage sensor state error sel */
++0X81, 0x00,		/* HID Input (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x02, 0x02,	/* HID usage sensor event */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0xA1, 0x02,		/* HID end collection (logical) */
++0x0A, 0x10, 0x08,	/* HID usage sensor event unknown sel */
++0x0A, 0x11, 0x08,	/* HID usage sensor event state changed sel */
++0x0A, 0x12, 0x08,	/* HID usage sensor event property changed sel */
++0x0A, 0x13, 0x08,	/* HID usage sensor event data updated sel */
++0x0A, 0x14, 0x08,	/* HID usage sensor event poll response sel */
++0x0A, 0x15, 0x08,	/* HID usage sensor event change sensitivity sel */
++0X81, 0x00,		/* HID Input (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x85, 0x04,	/* Sensor data orientation magnetic flux X axis */
++0x17, 0x00, 0x00, 0x01, 0x80,	/* HID logical Min_32 */
++0x27, 0xFF, 0xFF, 0xFF, 0x7F,	/* HID logical Max_32 */
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0D,		/* HID unit exponent(0x0D) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0x0A, 0x86, 0x04,	/* Sensor data orientation magnetic flux Y axis */
++0x17, 0x00, 0x00, 0x01, 0x80,	/* HID logical Min_32 */
++0x27, 0xFF, 0xFF, 0xFF, 0x7F,	/* HID logical Max_32 */
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0x55, 0x0D,		/* HID unit exponent(0x0D) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0x0A, 0x87, 0x04,	/* Sensor data orientation magnetic flux Z axis */
++0x17, 0x00, 0x00, 0x01, 0x80,	/* HID logical Min_32 */
++0x27, 0xFF, 0xFF, 0xFF, 0x7F,	/* HID logical Max_32 */
++0x75, 32,			/* HID report size(32) */
++0x95, 1,			/* HID report count (1) */
++0x55, 0x0D,			/* HID unit exponent(0x0D) */
++0X81, 0x02,			/* HID Input (Data_Arr_Abs) */
++0x0A, 0x88, 0x04,	/* Sensor data orientation magnetometer accuracy */
++0x17, 0x00, 0x00, 0x01, 0x80,	/* HID logical Min_32 */
++0x27, 0xFF, 0xFF, 0xFF, 0x7F,	/* HID logical Max_32 */
++0x75, 32,			/* HID report size(32) */
++0x95, 1,			/* HID report count (1) */
++0X81, 0x02,			/* HID Input (Data_Arr_Abs) */
++0xC0				/* HID end collection */
++};
++
++const u8 als_report_descriptor[] = {
++0x05, 0x20,	/* HID usage page sensor */
++0x09, 0x41,	/* HID usage sensor type Ambientlight  */
++0xA1, 0x00,	/* HID Collection (Physical) */
++
++//feature reports(xmit/receive)//
++0x85, 4,		/* HID  Report ID */
++0x05, 0x20,		/* HID usage page sensor */
++0x0A, 0x09, 0x03,	/* Sensor property and sensor connection type */
++0x15, 0,		/* HID logical MIN_8(0) */
++0x25, 2,		/* HID logical MAX_8(2) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection (logical) */
++0x0A, 0x30, 0x08,	/* Sensor property connection type intergated sel */
++0x0A, 0x31, 0x08,	/* Sensor property connection type attached sel */
++0x0A, 0x32, 0x08,	/* Sensor property connection type external sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x16, 0x03,	/* HID usage sensor property reporting state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x40, 0x08,	/* Sensor reporting state no events sel */
++0x0A, 0x41, 0x08,	/* Sensor reporting state all events sel */
++0x0A, 0x42, 0x08,	/* Sensor reporting state threshold events sel */
++0x0A, 0x43, 0x08,	/* Sensor reporting state no events wake sel */
++0x0A, 0x44, 0x08,	/* Sensor reporting state all events wake sel */
++0x0A, 0x45, 0x08,	/* Sensor reporting state threshold events wake sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x19, 0x03,	/* HID usage sensor property power state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x50, 0x08,	/* Sensor power state undefined sel */
++0x0A, 0x51, 0x08,	/* Sensor power state D0 full power  sel */
++0x0A, 0x52, 0x08,	/* Sensor power state D1 low power sel */
++0x0A, 0x53, 0x08,	/* Sensor power state D2 standby with wake sel */
++0x0A, 0x54, 0x08,	/* Sensor power state D3 sleep with wake  sel */
++0x0A, 0x55, 0x08,	/* Sensor power state D4 power off sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x01, 0x02,	/* HID usage sensor state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 6,		/* HID logical Max_8(6) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count(1) */
++0xA1, 0x02,		/* HID collection(logical) */
++0x0A, 0x00, 0x08,	/* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,	/* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,	/* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,	/* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,	/* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,	/* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,	/* HID usage sensor state error sel */
++0xB1, 0x00,		/* HID feature (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x0E, 0x03,	/* HID usage sensor property report interval */
++0x15, 0,		/* HID logical Min_8(0) */
++0x27, 0xFF, 0xFF, 0xFF, 0xFF,	/* HID logical Max_32 */
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0,		/* HID unit exponent(0) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0xD1, 0xE4,	/* Light illuminance and sensitivity REL PCT) */
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0x10, 0x27,	/* HID logical Max_16(0x10,0x27) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0E,		/* HID unit exponent(0x0E) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0xD1, 0x24,	/* Sensor data (Light illuminance and mod max) */
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0xFF, 0xFF,	/* HID logical Max_16(0xFF,0xFF) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++0x0A, 0xD1, 0x34,	/* Sensor data (Light illuminance and mod min) */
++0x15, 0,		/* HID logical Min_8(0) */
++0x26, 0xFF, 0xFF,	/* HID logical Max_16(0xFF,0xFF) */
++0x75, 16,		/* HID report size(16) */
++0x95, 1,		/* HID report count(1) */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0xB1, 0x02,		/* HID feature (Data_Arr_Abs) */
++
++//Input reports (transmit)
++0x05, 0x20,		/* HID usage page sensors */
++0x0A, 0x01, 0x02,	/* HID usage sensor state */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 6,		/* HID logical Max_8(6) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0xA1, 0x02,		/* HID end collection (logical) */
++0x0A, 0x00, 0x08,	/* HID usage sensor state unknown sel */
++0x0A, 0x01, 0x08,	/* HID usage sensor state ready sel */
++0x0A, 0x02, 0x08,	/* HID usage sensor state not available sel */
++0x0A, 0x03, 0x08,	/* HID usage sensor state no data sel */
++0x0A, 0x04, 0x08,	/* HID usage sensor state initializing sel */
++0x0A, 0x05, 0x08,	/* HID usage sensor state access denied sel */
++0x0A, 0x06, 0x08,	/* HID usage sensor state error sel */
++0X81, 0x00,		/* HID Input (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0x02, 0x02,	/* HID usage sensor event */
++0x15, 0,		/* HID logical Min_8(0) */
++0x25, 5,		/* HID logical Max_8(5) */
++0x75, 8,		/* HID report size(8) */
++0x95, 1,		/* HID report count (1) */
++0xA1, 0x02,		/* HID end collection (logical) */
++0x0A, 0x10, 0x08,	/* HID usage sensor event unknown sel */
++0x0A, 0x11, 0x08,	/* HID usage sensor event state changed sel */
++0x0A, 0x12, 0x08,	/* HID usage sensor event property changed sel */
++0x0A, 0x13, 0x08,	/* HID usage sensor event data updated sel */
++0x0A, 0x14, 0x08,	/* HID usage sensor event poll response sel */
++0x0A, 0x15, 0x08,	/* HID usage sensor event change sensitivity sel */
++0X81, 0x00,		/* HID Input (Data_Arr_Abs) */
++0xC0,			/* HID end collection */
++0x0A, 0xD1, 0x04,	/* HID usage sensor data light illuminance */
++0x17, 0x00, 0x00, 0x01, 0x80,	 /* HID logical Min_32 */
++0x27, 0xFF, 0xFF, 0xFF, 0x7F,	 /* HID logical Max_32 */
++0x55, 0x0F,		/* HID unit exponent(0x0F) */
++0x75, 32,		/* HID report size(32) */
++0x95, 1,		/* HID report count (1) */
++0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
++0xC0			/* HID end collection */
++};
++#endif
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/Kconfig linux-5.10.2-amd/drivers/hid/amd-sfh-hid/Kconfig
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/Kconfig	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/Kconfig	2020-12-25 14:25:44.298391979 +0100
+@@ -0,0 +1,18 @@
++# SPDX-License-Identifier: GPL-2.0-or-later
++menu "AMD SFH HID Support"
++	depends on X86_64 || COMPILE_TEST
++	depends on PCI
++	depends on HID
++
++config AMD_SFH_HID
++	tristate "AMD Sensor Fusion Hub"
++	help
++	  If you say yes to this option, support will be included for the
++	  AMD Sensor Fusion Hub.
++	  This driver will enable sensors functionality on AMD platforms
++	  starting from 17h family of RYZEN parts.
++
++	  This driver can also be built as a module. If so, the module will
++	  be called amd-sfh.
++	  Say Y or M here if you want to support AMD SFH. If unsure, say N.
++endmenu
+diff -Naur linux-5.10.2/drivers/hid/amd-sfh-hid/Makefile linux-5.10.2-amd/drivers/hid/amd-sfh-hid/Makefile
+--- linux-5.10.2/drivers/hid/amd-sfh-hid/Makefile	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/amd-sfh-hid/Makefile	2020-12-25 14:25:44.298391979 +0100
+@@ -0,0 +1,13 @@
++# SPDX-License-Identifier: GPL-2.0-or-later
++#
++# Makefile - AMD SFH HID drivers
++# Copyright (c) 2019-2020, Advanced Micro Devices, Inc.
++#
++#
++obj-$(CONFIG_AMD_SFH_HID) += amd_sfh.o
++amd_sfh-objs := amd_sfh_hid.o
++amd_sfh-objs += amd_sfh_client.o
++amd_sfh-objs += amd_sfh_pcie.o
++amd_sfh-objs += hid_descriptor/amd_sfh_hid_desc.o
++
++ccflags-y += -I $(srctree)/$(src)/
+diff -Naur linux-5.10.2/drivers/hid/Kconfig linux-5.10.2-amd/drivers/hid/Kconfig
+--- linux-5.10.2/drivers/hid/Kconfig	2020-12-21 13:30:08.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/Kconfig	2020-12-25 14:27:01.284205047 +0100
+@@ -1183,4 +1183,6 @@
+ 
+ source "drivers/hid/intel-ish-hid/Kconfig"
+ 
++source "drivers/hid/amd-sfh-hid/Kconfig"
++
+ endmenu
+diff -Naur linux-5.10.2/drivers/hid/Makefile linux-5.10.2-amd/drivers/hid/Makefile
+--- linux-5.10.2/drivers/hid/Makefile	2020-12-21 13:30:08.000000000 +0100
++++ linux-5.10.2-amd/drivers/hid/Makefile	2020-12-25 15:14:25.713530171 +0100
+@@ -142,3 +142,4 @@
+ 
+ obj-$(CONFIG_INTEL_ISH_HID)	+= intel-ish-hid/
+ obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER)	+= intel-ish-hid/
++obj-$(CONFIG_AMD_SFH_HID)	+= amd-sfh-hid/
diff --git a/add-sbtsi_driver.patch b/add-sbtsi_driver.patch
new file mode 100644
index 0000000..1303507
--- /dev/null
+++ b/add-sbtsi_driver.patch
@@ -0,0 +1,285 @@
+diff -Naur linux-5.10.2/drivers/hwmon/Kconfig linux-5.10.2-p/drivers/hwmon/Kconfig
+--- linux-5.10.2/drivers/hwmon/Kconfig	2020-12-21 13:30:08.000000000 +0100
++++ linux-5.10.2-p/drivers/hwmon/Kconfig	2020-12-25 13:49:22.911559911 +0100
+@@ -1499,6 +1499,16 @@
+ 	  This driver can also be built as a module.  If so, the module
+ 	  will be called sl28cpld-hwmon.
+ 
++config SENSORS_SBTSI
++	tristate "Emulated SB-TSI temperature sensor"
++	depends on I2C
++	help
++	  If you say yes here you get support for emulated temperature
++	  sensors on AMD SoCs with SB-TSI interface connected to a BMC device.
++
++	  This driver can also be built as a module. If so, the module will
++	  be called sbtsi_temp.
++
+ config SENSORS_SHT15
+ 	tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
+ 	depends on GPIOLIB || COMPILE_TEST
+diff -Naur linux-5.10.2/drivers/hwmon/Makefile linux-5.10.2-p/drivers/hwmon/Makefile
+--- linux-5.10.2/drivers/hwmon/Makefile	2020-12-21 13:30:08.000000000 +0100
++++ linux-5.10.2-p/drivers/hwmon/Makefile	2020-12-25 13:49:22.911559911 +0100
+@@ -158,6 +158,7 @@
+ obj-$(CONFIG_SENSORS_PWM_FAN)	+= pwm-fan.o
+ obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON)	+= raspberrypi-hwmon.o
+ obj-$(CONFIG_SENSORS_S3C)	+= s3c-hwmon.o
++obj-$(CONFIG_SENSORS_SBTSI)	+= sbtsi_temp.o
+ obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o
+ obj-$(CONFIG_SENSORS_SCH5627)	+= sch5627.o
+ obj-$(CONFIG_SENSORS_SCH5636)	+= sch5636.o
+diff -Naur linux-5.10.2/drivers/hwmon/sbtsi_temp.c linux-5.10.2-p/drivers/hwmon/sbtsi_temp.c
+--- linux-5.10.2/drivers/hwmon/sbtsi_temp.c	1970-01-01 01:00:00.000000000 +0100
++++ linux-5.10.2-p/drivers/hwmon/sbtsi_temp.c	2020-12-25 13:49:22.911559911 +0100
+@@ -0,0 +1,250 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ * sbtsi_temp.c - hwmon driver for a SBI Temperature Sensor Interface (SB-TSI)
++ *                compliant AMD SoC temperature device.
++ *
++ * Copyright (c) 2020, Google Inc.
++ * Copyright (c) 2020, Kun Yi <kunyi@google.com>
++ */
++
++#include <linux/err.h>
++#include <linux/i2c.h>
++#include <linux/init.h>
++#include <linux/hwmon.h>
++#include <linux/module.h>
++#include <linux/mutex.h>
++#include <linux/of_device.h>
++#include <linux/of.h>
++
++/*
++ * SB-TSI registers only support SMBus byte data access. "_INT" registers are
++ * the integer part of a temperature value or limit, and "_DEC" registers are
++ * corresponding decimal parts.
++ */
++#define SBTSI_REG_TEMP_INT		0x01 /* RO */
++#define SBTSI_REG_STATUS		0x02 /* RO */
++#define SBTSI_REG_CONFIG		0x03 /* RO */
++#define SBTSI_REG_TEMP_HIGH_INT		0x07 /* RW */
++#define SBTSI_REG_TEMP_LOW_INT		0x08 /* RW */
++#define SBTSI_REG_TEMP_DEC		0x10 /* RW */
++#define SBTSI_REG_TEMP_HIGH_DEC		0x13 /* RW */
++#define SBTSI_REG_TEMP_LOW_DEC		0x14 /* RW */
++
++#define SBTSI_CONFIG_READ_ORDER_SHIFT	5
++
++#define SBTSI_TEMP_MIN	0
++#define SBTSI_TEMP_MAX	255875
++
++/* Each client has this additional data */
++struct sbtsi_data {
++	struct i2c_client *client;
++	struct mutex lock;
++};
++
++/*
++ * From SB-TSI spec: CPU temperature readings and limit registers encode the
++ * temperature in increments of 0.125 from 0 to 255.875. The "high byte"
++ * register encodes the base-2 of the integer portion, and the upper 3 bits of
++ * the "low byte" encode in base-2 the decimal portion.
++ *
++ * e.g. INT=0x19, DEC=0x20 represents 25.125 degrees Celsius
++ *
++ * Therefore temperature in millidegree Celsius =
++ *   (INT + DEC / 256) * 1000 = (INT * 8 + DEC / 32) * 125
++ */
++static inline int sbtsi_reg_to_mc(s32 integer, s32 decimal)
++{
++	return ((integer << 3) + (decimal >> 5)) * 125;
++}
++
++/*
++ * Inversely, given temperature in millidegree Celsius
++ *   INT = (TEMP / 125) / 8
++ *   DEC = ((TEMP / 125) % 8) * 32
++ * Caller have to make sure temp doesn't exceed 255875, the max valid value.
++ */
++static inline void sbtsi_mc_to_reg(s32 temp, u8 *integer, u8 *decimal)
++{
++	temp /= 125;
++	*integer = temp >> 3;
++	*decimal = (temp & 0x7) << 5;
++}
++
++static int sbtsi_read(struct device *dev, enum hwmon_sensor_types type,
++		      u32 attr, int channel, long *val)
++{
++	struct sbtsi_data *data = dev_get_drvdata(dev);
++	s32 temp_int, temp_dec;
++	int err;
++
++	switch (attr) {
++	case hwmon_temp_input:
++		/*
++		 * ReadOrder bit specifies the reading order of integer and
++		 * decimal part of CPU temp for atomic reads. If bit == 0,
++		 * reading integer part triggers latching of the decimal part,
++		 * so integer part should be read first. If bit == 1, read
++		 * order should be reversed.
++		 */
++		err = i2c_smbus_read_byte_data(data->client, SBTSI_REG_CONFIG);
++		if (err < 0)
++			return err;
++
++		mutex_lock(&data->lock);
++		if (err & BIT(SBTSI_CONFIG_READ_ORDER_SHIFT)) {
++			temp_dec = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_DEC);
++			temp_int = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_INT);
++		} else {
++			temp_int = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_INT);
++			temp_dec = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_DEC);
++		}
++		mutex_unlock(&data->lock);
++		break;
++	case hwmon_temp_max:
++		mutex_lock(&data->lock);
++		temp_int = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_HIGH_INT);
++		temp_dec = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_HIGH_DEC);
++		mutex_unlock(&data->lock);
++		break;
++	case hwmon_temp_min:
++		mutex_lock(&data->lock);
++		temp_int = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_LOW_INT);
++		temp_dec = i2c_smbus_read_byte_data(data->client, SBTSI_REG_TEMP_LOW_DEC);
++		mutex_unlock(&data->lock);
++		break;
++	default:
++		return -EINVAL;
++	}
++
++
++	if (temp_int < 0)
++		return temp_int;
++	if (temp_dec < 0)
++		return temp_dec;
++
++	*val = sbtsi_reg_to_mc(temp_int, temp_dec);
++
++	return 0;
++}
++
++static int sbtsi_write(struct device *dev, enum hwmon_sensor_types type,
++		       u32 attr, int channel, long val)
++{
++	struct sbtsi_data *data = dev_get_drvdata(dev);
++	int reg_int, reg_dec, err;
++	u8 temp_int, temp_dec;
++
++	switch (attr) {
++	case hwmon_temp_max:
++		reg_int = SBTSI_REG_TEMP_HIGH_INT;
++		reg_dec = SBTSI_REG_TEMP_HIGH_DEC;
++		break;
++	case hwmon_temp_min:
++		reg_int = SBTSI_REG_TEMP_LOW_INT;
++		reg_dec = SBTSI_REG_TEMP_LOW_DEC;
++		break;
++	default:
++		return -EINVAL;
++	}
++
++	val = clamp_val(val, SBTSI_TEMP_MIN, SBTSI_TEMP_MAX);
++	sbtsi_mc_to_reg(val, &temp_int, &temp_dec);
++
++	mutex_lock(&data->lock);
++	err = i2c_smbus_write_byte_data(data->client, reg_int, temp_int);
++	if (err)
++		goto exit;
++
++	err = i2c_smbus_write_byte_data(data->client, reg_dec, temp_dec);
++exit:
++	mutex_unlock(&data->lock);
++	return err;
++}
++
++static umode_t sbtsi_is_visible(const void *data,
++				enum hwmon_sensor_types type,
++				u32 attr, int channel)
++{
++	switch (type) {
++	case hwmon_temp:
++		switch (attr) {
++		case hwmon_temp_input:
++			return 0444;
++		case hwmon_temp_min:
++			return 0644;
++		case hwmon_temp_max:
++			return 0644;
++		}
++		break;
++	default:
++		break;
++	}
++	return 0;
++}
++
++static const struct hwmon_channel_info *sbtsi_info[] = {
++	HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
++	HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MIN | HWMON_T_MAX),
++	NULL
++};
++
++static const struct hwmon_ops sbtsi_hwmon_ops = {
++	.is_visible = sbtsi_is_visible,
++	.read = sbtsi_read,
++	.write = sbtsi_write,
++};
++
++static const struct hwmon_chip_info sbtsi_chip_info = {
++	.ops = &sbtsi_hwmon_ops,
++	.info = sbtsi_info,
++};
++
++static int sbtsi_probe(struct i2c_client *client,
++		       const struct i2c_device_id *id)
++{
++	struct device *dev = &client->dev;
++	struct device *hwmon_dev;
++	struct sbtsi_data *data;
++
++	data = devm_kzalloc(dev, sizeof(struct sbtsi_data), GFP_KERNEL);
++	if (!data)
++		return -ENOMEM;
++
++	data->client = client;
++	mutex_init(&data->lock);
++
++	hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, data, &sbtsi_chip_info,
++							 NULL);
++
++	return PTR_ERR_OR_ZERO(hwmon_dev);
++}
++
++static const struct i2c_device_id sbtsi_id[] = {
++	{"sbtsi", 0},
++	{}
++};
++MODULE_DEVICE_TABLE(i2c, sbtsi_id);
++
++static const struct of_device_id __maybe_unused sbtsi_of_match[] = {
++	{
++		.compatible = "amd,sbtsi",
++	},
++	{ },
++};
++MODULE_DEVICE_TABLE(of, sbtsi_of_match);
++
++static struct i2c_driver sbtsi_driver = {
++	.class = I2C_CLASS_HWMON,
++	.driver = {
++		.name = "sbtsi",
++		.of_match_table = of_match_ptr(sbtsi_of_match),
++	},
++	.probe = sbtsi_probe,
++	.id_table = sbtsi_id,
++};
++
++module_i2c_driver(sbtsi_driver);
++
++MODULE_AUTHOR("Kun Yi <kunyi@google.com>");
++MODULE_DESCRIPTION("Hwmon driver for AMD SB-TSI emulated sensor");
++MODULE_LICENSE("GPL");
diff --git a/armv7hnl-desktop-omv-defconfig b/armv7hnl-desktop-omv-defconfig
index f22aef5..2727e5c 100644
--- a/armv7hnl-desktop-omv-defconfig
+++ b/armv7hnl-desktop-omv-defconfig
@@ -5389,6 +5389,8 @@ CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_PWM_FAN=m
 CONFIG_SENSORS_SL28CPLD=m
+# CONFIG_SENSORS_SBTSI is not set
+# CONFIG_AMD_SFH_HID is not set
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
diff --git a/armv7hnl-server-omv-defconfig b/armv7hnl-server-omv-defconfig
index 00624d1..bde81a1 100644
--- a/armv7hnl-server-omv-defconfig
+++ b/armv7hnl-server-omv-defconfig
@@ -5389,6 +5389,8 @@ CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_PWM_FAN=m
 CONFIG_SENSORS_SL28CPLD=m
+# CONFIG_SENSORS_SBTSI is not set
+# CONFIG_AMD_SFH_HID is not set
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
diff --git a/enable-new-amd-energy-driver-for-all-ryzen.patch b/enable-new-amd-energy-driver-for-all-ryzen.patch
index 50765f9..3d7a494 100644
--- a/enable-new-amd-energy-driver-for-all-ryzen.patch
+++ b/enable-new-amd-energy-driver-for-all-ryzen.patch
@@ -1,11 +1,13 @@
---- linux-5.8/drivers/hwmon/amd_energy.c	2020-08-02 23:21:45.000000000 +0200
-+++ linux-5.8.new/drivers/hwmon/amd_energy.c	2020-08-05 13:15:32.888209183 +0200
-@@ -362,7 +362,7 @@
+diff -Naur linux-5.10.2/drivers/hwmon/amd_energy.c linux-5.10.2-p/drivers/hwmon/amd_energy.c
+--- linux-5.10.2/drivers/hwmon/amd_energy.c	2020-12-21 13:30:08.000000000 +0100
++++ linux-5.10.2-p/drivers/hwmon/amd_energy.c	2020-12-25 16:41:30.326691167 +0100
+@@ -330,7 +330,8 @@
  static struct platform_device *amd_energy_platdev;
  
  static const struct x86_cpu_id cpu_ids[] __initconst = {
 -	X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
 +	X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
++	X86_MATCH_VENDOR_FAM(AMD, 0x19, NULL),
  	{}
  };
  MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
diff --git a/export-symbols-needed-by-android-drivers.patch b/export-symbols-needed-by-android-drivers.patch
index 0dd09a3..c964645 100644
--- a/export-symbols-needed-by-android-drivers.patch
+++ b/export-symbols-needed-by-android-drivers.patch
@@ -158,3 +158,25 @@ diff -up linux-5.9/security/security.c.37~ linux-5.9/security/security.c
  
  int security_ptrace_access_check(struct task_struct *child, unsigned int mode)
  {
+diff -up linux-5.10/ipc/msgutil.c.omv~ linux-5.10/ipc/msgutil.c
+--- linux-5.10/ipc/msgutil.c.omv~	2020-12-27 01:16:41.770345629 +0100
++++ linux-5.10/ipc/msgutil.c	2020-12-27 01:16:53.026491226 +0100
+@@ -33,6 +33,7 @@ struct ipc_namespace init_ipc_ns = {
+ 	.ns.ops = &ipcns_operations,
+ #endif
+ };
++EXPORT_SYMBOL_GPL(init_ipc_ns);
+ 
+ struct msg_msgseg {
+ 	struct msg_msgseg *next;
+diff -up linux-5.10/ipc/namespace.c.omv~ linux-5.10/ipc/namespace.c
+--- linux-5.10/ipc/namespace.c.omv~	2020-12-27 01:19:48.196765724 +0100
++++ linux-5.10/ipc/namespace.c	2020-12-27 01:20:03.157960652 +0100
+@@ -172,6 +172,7 @@ void put_ipc_ns(struct ipc_namespace *ns
+ 			schedule_work(&free_ipc_work);
+ 	}
+ }
++EXPORT_SYMBOL_GPL(put_ipc_ns);
+ 
+ static inline struct ipc_namespace *to_ipc_ns(struct ns_common *ns)
+ {
diff --git a/i686-desktop-gcc-omv-defconfig b/i686-desktop-gcc-omv-defconfig
index cf2c618..2b40a45 100644
--- a/i686-desktop-gcc-omv-defconfig
+++ b/i686-desktop-gcc-omv-defconfig
@@ -4991,6 +4991,8 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_SL28CPLD=m
+CONFIG_SENSORS_SBTSI=m
+CONFIG_AMD_SFH_HID=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
diff --git a/i686-server-gcc-omv-defconfig b/i686-server-gcc-omv-defconfig
index 90737bc..a41ac2f 100644
--- a/i686-server-gcc-omv-defconfig
+++ b/i686-server-gcc-omv-defconfig
@@ -4992,6 +4992,8 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_SL28CPLD=m
+CONFIG_SENSORS_SBTSI=m
+CONFIG_AMD_SFH_HID=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
diff --git a/k10temp-fix-ZEN2-desktop-add-ZEN3-desktop.patch b/k10temp-fix-ZEN2-desktop-add-ZEN3-desktop.patch
new file mode 100644
index 0000000..ed381bf
--- /dev/null
+++ b/k10temp-fix-ZEN2-desktop-add-ZEN3-desktop.patch
@@ -0,0 +1,94 @@
+diff -Naur linux-5.10.2/drivers/hwmon/k10temp.c linux-5.10.2-p/drivers/hwmon/k10temp.c
+--- linux-5.10.2/drivers/hwmon/k10temp.c	2020-12-21 13:30:08.000000000 +0100
++++ linux-5.10.2-p/drivers/hwmon/k10temp.c	2020-12-22 18:15:23.686670195 +0100
+@@ -87,17 +87,28 @@
+ /* F17h thermal registers through SMN */
+ #define F17H_M01H_SVI_TEL_PLANE0		(ZEN_SVI_BASE + 0xc)
+ #define F17H_M01H_SVI_TEL_PLANE1		(ZEN_SVI_BASE + 0x10)
++/* ZEN2 SP3/TR */
+ #define F17H_M31H_SVI_TEL_PLANE0		(ZEN_SVI_BASE + 0x14)
+ #define F17H_M31H_SVI_TEL_PLANE1		(ZEN_SVI_BASE + 0x10)
+ 
++/* ZEN2 Ryzen Desktop */
++#define F17H_M71H_SVI_TEL_PLANE0        (ZEN_SVI_BASE + 0x10)
++#define F17H_M71H_SVI_TEL_PLANE1        (ZEN_SVI_BASE + 0xc)
++
++/* fixme: figure these */
+ #define F17H_M01H_CFACTOR_ICORE			1000000	/* 1A / LSB	*/
+ #define F17H_M01H_CFACTOR_ISOC			250000	/* 0.25A / LSB	*/
+ #define F17H_M31H_CFACTOR_ICORE			1000000	/* 1A / LSB	*/
+ #define F17H_M31H_CFACTOR_ISOC			310000	/* 0.31A / LSB	*/
+ 
+ /* F19h thermal registers through SMN */
+-#define F19H_M01_SVI_TEL_PLANE0			(ZEN_SVI_BASE + 0x14)
+-#define F19H_M01_SVI_TEL_PLANE1			(ZEN_SVI_BASE + 0x10)
++/* ZEN3 SP3/TR */
++#define F19H_M01H_SVI_TEL_PLANE0		(ZEN_SVI_BASE + 0x14)
++#define F19H_M01H_SVI_TEL_PLANE1		(ZEN_SVI_BASE + 0x10)
++
++/* ZEN3 Ryzen Desktop */
++#define F19H_M21H_SVI_TEL_PLANE0		(ZEN_SVI_BASE + 0x10)
++#define F19H_M21H_SVI_TEL_PLANE1		(ZEN_SVI_BASE + 0xc)
+ 
+ #define F19H_M01H_CFACTOR_ICORE			1000000	/* 1A / LSB	*/
+ #define F19H_M01H_CFACTOR_ISOC			310000	/* 0.31A / LSB	*/
+@@ -513,6 +524,7 @@
+ 		data->is_zen = true;
+ 
+ 		switch (boot_cpu_data.x86_model) {
++		/* FIXME: those looks wrong too */
+ 		case 0x1:	/* Zen */
+ 		case 0x8:	/* Zen+ */
+ 		case 0x11:	/* Zen APU */
+@@ -524,8 +536,7 @@
+ 			data->cfactor[1] = F17H_M01H_CFACTOR_ISOC;
+ 			k10temp_get_ccd_support(pdev, data, 4);
+ 			break;
+-		case 0x31:	/* Zen2 Threadripper */
+-		case 0x71:	/* Zen2 */
++		case 0x31:	/* Zen2 SP3/TR */
+ 			data->show_current = !is_threadripper() && !is_epyc();
+ 			data->cfactor[0] = F17H_M31H_CFACTOR_ICORE;
+ 			data->cfactor[1] = F17H_M31H_CFACTOR_ISOC;
+@@ -533,6 +544,14 @@
+ 			data->svi_addr[1] = F17H_M31H_SVI_TEL_PLANE1;
+ 			k10temp_get_ccd_support(pdev, data, 8);
+ 			break;
++		case 0x71:  /* ZEN2 Ryzen Desktop */
++			data->show_current = true;
++			data->cfactor[0] = F17H_M31H_CFACTOR_ICORE;
++			data->cfactor[1] = F17H_M31H_CFACTOR_ISOC;
++			data->svi_addr[0] = F17H_M71H_SVI_TEL_PLANE0;
++			data->svi_addr[1] = F17H_M71H_SVI_TEL_PLANE1;
++			k10temp_get_ccd_support(pdev, data, 4);
++			break;
+ 		}
+ 	} else if (boot_cpu_data.x86 == 0x19) {
+ 		data->temp_adjust_mask = ZEN_CUR_TEMP_RANGE_SEL_MASK;
+@@ -541,14 +560,23 @@
+ 		data->is_zen = true;
+ 
+ 		switch (boot_cpu_data.x86_model) {
+-		case 0x0 ... 0x1:	/* Zen3 */
++		case 0x0 ... 0x1:	/* Zen3 SP3/TR */
+ 			data->show_current = true;
+-			data->svi_addr[0] = F19H_M01_SVI_TEL_PLANE0;
+-			data->svi_addr[1] = F19H_M01_SVI_TEL_PLANE1;
++			data->svi_addr[0] = F19H_M01H_SVI_TEL_PLANE0;
++			data->svi_addr[1] = F19H_M01H_SVI_TEL_PLANE1;
+ 			data->cfactor[0] = F19H_M01H_CFACTOR_ICORE;
+ 			data->cfactor[1] = F19H_M01H_CFACTOR_ISOC;
+ 			k10temp_get_ccd_support(pdev, data, 8);
+ 			break;
++		case 0x21:  /* ZEN3 Ryzen Desktop */
++			data->show_current = true;
++			data->svi_addr[0] = F19H_M21H_SVI_TEL_PLANE0;
++			data->svi_addr[1] = F19H_M21H_SVI_TEL_PLANE1;
++			data->cfactor[0] = F19H_M01H_CFACTOR_ICORE;
++			data->cfactor[1] = F19H_M01H_CFACTOR_ISOC;
++			k10temp_get_ccd_support(pdev, data, 2);
++			break;
++
+ 		}
+ 	} else {
+ 		data->read_htcreg = read_htcreg_pci;
diff --git a/kernel-release.spec b/kernel-release.spec
index 846781a..4c2cf88 100644
--- a/kernel-release.spec
+++ b/kernel-release.spec
@@ -22,7 +22,7 @@
 # compose tar.xz name and release
 %define kernelversion	5
 %define patchlevel	10
-%define sublevel	2
+%define sublevel	3
 %define relc		%{nil}
 # Only ever wrong on x.0 releases...
 %define previous	%{kernelversion}.%(echo $((%{patchlevel}-1)))
@@ -36,7 +36,7 @@
 %define rpmrel		0.rc%{relc}.1
 %define tar_ver		%{kernelversion}.%{patchlevel}-rc%{relc}
 %else
-%define rpmrel		2
+%define rpmrel		1
 %define tar_ver		%{kernelversion}.%{patchlevel}
 %endif
 %define buildrpmrel	%{rpmrel}%{rpmtag}
@@ -245,8 +245,6 @@ Patch1:		compress-modules-zstd.patch
 # (crazy) That is always a error on Ryzen platform, which is not fatal
 # just different, lower to info since it breaks the splash
 Patch2:		amd_iommu_init_info.patch
-# (crazy) while not perfect on all Ryzen platforms better that nothing
-Patch3: 	enable-new-amd-energy-driver-for-all-ryzen.patch
 # (crazy) I really need to send that upstream soon
 Patch10:	iwlwifi-fix-5e003982b07ae.patch
 Patch30:	linux-5.6-fix-disassembler-4args-detection.patch
@@ -339,6 +337,19 @@ Patch213:	https://salsa.debian.org/kernel-team/linux/raw/master/debian/patches/d
 # https://patchwork.freedesktop.org/patch/408230/
 Patch220:	8353d30e747f-drm-amd-display-disable-stream-if-pixel-clock-changed-with-link-active.patch
 
+# k10temp fixes
+Patch221:	https://gitweb.frugalware.org/frugalware-current/raw/2fe3eaa10ecbeb59db965230a1d1aa0a775f6b5a/source/base/kernel/k10temp-fix-ZEN2-desktop-add-ZEN3-desktop.patch
+
+# Backported extra AMD drivers
+Patch222:	https://gitweb.frugalware.org/frugalware-current/raw/e4ce7d381051c513cf9ba5443b255534d48ce90a/source/base/kernel/add-amd-sfh-hid_driver.patch
+Patch223:	https://gitweb.frugalware.org/frugalware-current/raw/e4ce7d381051c513cf9ba5443b255534d48ce90a/source/base/kernel/add-sbtsi_driver.patch
+Patch224:	https://gitweb.frugalware.org/frugalware-current/raw/9feb87fc5d15fc0b31f5e0cfa2bab188c4e6575a/source/base/kernel/enable-new-amd-energy-driver-for-all-ryzen.patch
+
+# Fix CPU frequency governor mess caused by recent Intel patches
+Patch225:	https://gitweb.frugalware.org/frugalware-current/raw/50690405717979871bb17b8e6b553799a203c6ae/source/base/kernel/0001-Revert-cpufreq-Avoid-configuring-old-governors-as-de.patch
+Patch226:	https://gitweb.frugalware.org/frugalware-current/raw/50690405717979871bb17b8e6b553799a203c6ae/source/base/kernel/revert-parts-of-a00ec3874e7d326ab2dffbed92faddf6a77a84e9-no-Intel-NO.patch
+
+
 # NTFS kernel patches
 # https://lore.kernel.org/lkml/20201204154600.1546096-1-almaz.alexandrovich@paragon-software.com/
 Patch300:	PATCH-v14-01-10-fs-ntfs3-Add-headers-and-misc-files.patch
diff --git a/revert-parts-of-a00ec3874e7d326ab2dffbed92faddf6a77a84e9-no-Intel-NO.patch b/revert-parts-of-a00ec3874e7d326ab2dffbed92faddf6a77a84e9-no-Intel-NO.patch
new file mode 100644
index 0000000..dec5766
--- /dev/null
+++ b/revert-parts-of-a00ec3874e7d326ab2dffbed92faddf6a77a84e9-no-Intel-NO.patch
@@ -0,0 +1,12 @@
+diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
+index 85de313ddec2..1b2a7160981c 100644
+--- a/drivers/cpufreq/Kconfig
++++ b/drivers/cpufreq/Kconfig
+@@ -38,7 +38,6 @@ choice
+ 	prompt "Default CPUFreq governor"
+ 	default CPU_FREQ_DEFAULT_GOV_USERSPACE if ARM_SA1100_CPUFREQ || ARM_SA1110_CPUFREQ
+ 	default CPU_FREQ_DEFAULT_GOV_SCHEDUTIL if ARM64 || ARM
+-	default CPU_FREQ_DEFAULT_GOV_SCHEDUTIL if X86_INTEL_PSTATE && SMP
+ 	default CPU_FREQ_DEFAULT_GOV_PERFORMANCE
+ 	help
+ 	  This option sets which CPUFreq governor shall be loaded at
diff --git a/x86_64-desktop-gcc-omv-defconfig b/x86_64-desktop-gcc-omv-defconfig
index 00674aa..e5848ca 100644
--- a/x86_64-desktop-gcc-omv-defconfig
+++ b/x86_64-desktop-gcc-omv-defconfig
@@ -4970,6 +4970,8 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_SL28CPLD=m
+CONFIG_SENSORS_SBTSI=m
+CONFIG_AMD_SFH_HID=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
@@ -9355,7 +9357,15 @@ CONFIG_USB4=m
 #
 # Android
 #
-# CONFIG_ANDROID is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=m
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
+CONFIG_ASHMEM=m
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
 # end of Android
 
 CONFIG_LIBNVDIMM=m
diff --git a/x86_64-server-gcc-omv-defconfig b/x86_64-server-gcc-omv-defconfig
index 28d04a3..286ea6c 100644
--- a/x86_64-server-gcc-omv-defconfig
+++ b/x86_64-server-gcc-omv-defconfig
@@ -4942,6 +4942,8 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_SL28CPLD=m
+CONFIG_SENSORS_SBTSI=m
+CONFIG_AMD_SFH_HID=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
@@ -9105,7 +9107,15 @@ CONFIG_USB4=m
 #
 # Android
 #
-# CONFIG_ANDROID is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=m
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
+CONFIG_ASHMEM=m
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
 # end of Android
 
 CONFIG_LIBNVDIMM=m
diff --git a/x86_64-znver-desktop-gcc-omv-defconfig b/x86_64-znver-desktop-gcc-omv-defconfig
index 711996e..b9c6ff0 100644
--- a/x86_64-znver-desktop-gcc-omv-defconfig
+++ b/x86_64-znver-desktop-gcc-omv-defconfig
@@ -4941,6 +4941,8 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_SL28CPLD=m
+CONFIG_SENSORS_SBTSI=m
+CONFIG_AMD_SFH_HID=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
@@ -9106,7 +9108,15 @@ CONFIG_USB4=m
 #
 # Android
 #
-# CONFIG_ANDROID is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=m
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
+CONFIG_ASHMEM=m
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
 # end of Android
 
 CONFIG_LIBNVDIMM=m
diff --git a/x86_64-znver-server-gcc-omv-defconfig b/x86_64-znver-server-gcc-omv-defconfig
index 9150644..5077d16 100644
--- a/x86_64-znver-server-gcc-omv-defconfig
+++ b/x86_64-znver-server-gcc-omv-defconfig
@@ -4941,6 +4941,8 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_XDPE122=m
 CONFIG_SENSORS_ZL6100=m
 CONFIG_SENSORS_SL28CPLD=m
+CONFIG_SENSORS_SBTSI=m
+CONFIG_AMD_SFH_HID=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SHT3x=m
@@ -9104,7 +9106,15 @@ CONFIG_USB4=m
 #
 # Android
 #
-# CONFIG_ANDROID is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=m
+CONFIG_ANDROID_BINDERFS=y
+CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
+# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
+CONFIG_ASHMEM=m
+CONFIG_ION=y
+CONFIG_ION_SYSTEM_HEAP=y
+CONFIG_ION_CMA_HEAP=y
 # end of Android
 
 CONFIG_LIBNVDIMM=m
Not Available
benbullard79 [@T] cox.netNo Comment.63d 12hrs
benbullard79 [@T] cox.netNo Comment.63d 12hrs
benbullard79 [@T] cox.netNo Comment.62d 12hrs
benbullard79 [@T] cox.netNo Comment.62d 12hrs