| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * axp288_fuel_gauge.c - Xpower AXP288 PMIC Fuel Gauge Driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright (C) 2014 Intel Corporation |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 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 | | - * |
|---|
| 18 | 9 | */ |
|---|
| 19 | 10 | |
|---|
| 20 | 11 | #include <linux/dmi.h> |
|---|
| .. | .. |
|---|
| 307 | 298 | return 0; |
|---|
| 308 | 299 | } |
|---|
| 309 | 300 | |
|---|
| 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); |
|---|
| 321 | 302 | |
|---|
| 322 | 303 | static void fuel_gauge_create_debugfs(struct axp288_fg_info *info) |
|---|
| 323 | 304 | { |
|---|
| 324 | 305 | info->debug_file = debugfs_create_file("fuelgauge", 0666, NULL, |
|---|
| 325 | | - info, &fg_debug_fops); |
|---|
| 306 | + info, &fuel_gauge_debug_fops); |
|---|
| 326 | 307 | } |
|---|
| 327 | 308 | |
|---|
| 328 | 309 | static void fuel_gauge_remove_debugfs(struct axp288_fg_info *info) |
|---|
| .. | .. |
|---|
| 693 | 674 | /* |
|---|
| 694 | 675 | * Some devices have no battery (HDMI sticks) and the axp288 battery's |
|---|
| 695 | 676 | * detection reports one despite it not being there. |
|---|
| 677 | + * Please keep this listed sorted alphabetically. |
|---|
| 696 | 678 | */ |
|---|
| 697 | 679 | static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = { |
|---|
| 698 | 680 | { |
|---|
| .. | .. |
|---|
| 716 | 698 | }, |
|---|
| 717 | 699 | }, |
|---|
| 718 | 700 | { |
|---|
| 701 | + /* ECS EF20EA */ |
|---|
| 702 | + .matches = { |
|---|
| 703 | + DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"), |
|---|
| 704 | + }, |
|---|
| 705 | + }, |
|---|
| 706 | + { |
|---|
| 719 | 707 | /* Intel Cherry Trail Compute Stick, Windows version */ |
|---|
| 720 | 708 | .matches = { |
|---|
| 721 | 709 | DMI_MATCH(DMI_SYS_VENDOR, "Intel"), |
|---|
| .. | .. |
|---|
| 730 | 718 | }, |
|---|
| 731 | 719 | }, |
|---|
| 732 | 720 | { |
|---|
| 721 | + /* Meegopad T02 */ |
|---|
| 722 | + .matches = { |
|---|
| 723 | + DMI_MATCH(DMI_PRODUCT_NAME, "MEEGOPAD T02"), |
|---|
| 724 | + }, |
|---|
| 725 | + }, |
|---|
| 726 | + { |
|---|
| 733 | 727 | /* Meegopad T08 */ |
|---|
| 734 | 728 | .matches = { |
|---|
| 735 | 729 | DMI_MATCH(DMI_SYS_VENDOR, "Default string"), |
|---|
| .. | .. |
|---|
| 739 | 733 | }, |
|---|
| 740 | 734 | }, |
|---|
| 741 | 735 | { |
|---|
| 742 | | - /* ECS EF20EA */ |
|---|
| 736 | + /* Minix Neo Z83-4 mini PC */ |
|---|
| 743 | 737 | .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 | + } |
|---|
| 746 | 741 | }, |
|---|
| 747 | 742 | {} |
|---|
| 748 | 743 | }; |
|---|