hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/power/supply/axp288_fuel_gauge.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * axp288_fuel_gauge.c - Xpower AXP288 PMIC Fuel Gauge Driver
34 *
....@@ -5,16 +6,6 @@
56 * Copyright (C) 2014 Intel Corporation
67 *
78 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; version 2 of the License.
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
17
- *
189 */
1910
2011 #include <linux/dmi.h>
....@@ -307,22 +298,12 @@
307298 return 0;
308299 }
309300
310
-static int debug_open(struct inode *inode, struct file *file)
311
-{
312
- return single_open(file, fuel_gauge_debug_show, inode->i_private);
313
-}
314
-
315
-static const struct file_operations fg_debug_fops = {
316
- .open = debug_open,
317
- .read = seq_read,
318
- .llseek = seq_lseek,
319
- .release = single_release,
320
-};
301
+DEFINE_SHOW_ATTRIBUTE(fuel_gauge_debug);
321302
322303 static void fuel_gauge_create_debugfs(struct axp288_fg_info *info)
323304 {
324305 info->debug_file = debugfs_create_file("fuelgauge", 0666, NULL,
325
- info, &fg_debug_fops);
306
+ info, &fuel_gauge_debug_fops);
326307 }
327308
328309 static void fuel_gauge_remove_debugfs(struct axp288_fg_info *info)
....@@ -693,6 +674,7 @@
693674 /*
694675 * Some devices have no battery (HDMI sticks) and the axp288 battery's
695676 * detection reports one despite it not being there.
677
+ * Please keep this listed sorted alphabetically.
696678 */
697679 static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
698680 {
....@@ -716,6 +698,12 @@
716698 },
717699 },
718700 {
701
+ /* ECS EF20EA */
702
+ .matches = {
703
+ DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
704
+ },
705
+ },
706
+ {
719707 /* Intel Cherry Trail Compute Stick, Windows version */
720708 .matches = {
721709 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
....@@ -730,6 +718,12 @@
730718 },
731719 },
732720 {
721
+ /* Meegopad T02 */
722
+ .matches = {
723
+ DMI_MATCH(DMI_PRODUCT_NAME, "MEEGOPAD T02"),
724
+ },
725
+ },
726
+ {
733727 /* Meegopad T08 */
734728 .matches = {
735729 DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
....@@ -739,10 +733,11 @@
739733 },
740734 },
741735 {
742
- /* ECS EF20EA */
736
+ /* Minix Neo Z83-4 mini PC */
743737 .matches = {
744
- DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
745
- },
738
+ DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
739
+ DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
740
+ }
746741 },
747742 {}
748743 };