From b22da3d8526a935aa31e086e63f60ff3246cb61c Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Sat, 09 Dec 2023 07:24:11 +0000 Subject: [PATCH] add stmac read mac form eeprom --- kernel/drivers/power/supply/axp288_fuel_gauge.c | 45 ++++++++++++++++++++------------------------- 1 files changed, 20 insertions(+), 25 deletions(-) diff --git a/kernel/drivers/power/supply/axp288_fuel_gauge.c b/kernel/drivers/power/supply/axp288_fuel_gauge.c index 1641868..be24529 100644 --- a/kernel/drivers/power/supply/axp288_fuel_gauge.c +++ b/kernel/drivers/power/supply/axp288_fuel_gauge.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * axp288_fuel_gauge.c - Xpower AXP288 PMIC Fuel Gauge Driver * @@ -5,16 +6,6 @@ * Copyright (C) 2014 Intel Corporation * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * */ #include <linux/dmi.h> @@ -307,22 +298,12 @@ return 0; } -static int debug_open(struct inode *inode, struct file *file) -{ - return single_open(file, fuel_gauge_debug_show, inode->i_private); -} - -static const struct file_operations fg_debug_fops = { - .open = debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(fuel_gauge_debug); static void fuel_gauge_create_debugfs(struct axp288_fg_info *info) { info->debug_file = debugfs_create_file("fuelgauge", 0666, NULL, - info, &fg_debug_fops); + info, &fuel_gauge_debug_fops); } static void fuel_gauge_remove_debugfs(struct axp288_fg_info *info) @@ -693,6 +674,7 @@ /* * Some devices have no battery (HDMI sticks) and the axp288 battery's * detection reports one despite it not being there. + * Please keep this listed sorted alphabetically. */ static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = { { @@ -716,6 +698,12 @@ }, }, { + /* ECS EF20EA */ + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"), + }, + }, + { /* Intel Cherry Trail Compute Stick, Windows version */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Intel"), @@ -730,6 +718,12 @@ }, }, { + /* Meegopad T02 */ + .matches = { + DMI_MATCH(DMI_PRODUCT_NAME, "MEEGOPAD T02"), + }, + }, + { /* Meegopad T08 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Default string"), @@ -739,10 +733,11 @@ }, }, { - /* ECS EF20EA */ + /* Minix Neo Z83-4 mini PC */ .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"), - }, + DMI_MATCH(DMI_SYS_VENDOR, "MINIX"), + DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"), + } }, {} }; -- Gitblit v1.6.2