From patchwork Wed Jan 29 20:43:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 11356835 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00AD914B7 for ; Wed, 29 Jan 2020 20:51:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFFA92071E for ; Wed, 29 Jan 2020 20:51:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Ny5Y29X9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726259AbgA2UvP (ORCPT ); Wed, 29 Jan 2020 15:51:15 -0500 Received: from ned.t-8ch.de ([212.47.237.191]:44328 "EHLO ned.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726742AbgA2UvO (ORCPT ); Wed, 29 Jan 2020 15:51:14 -0500 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1580330625; bh=4/3u1sKFM78XGpkDgV4KNfly5sI7hYOdhg5y4muK8Lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ny5Y29X98ytDCL1RVvsxIfwWNZCZjZyFTlWIBzSUmzZNWFK65Yl2R8Lv6u1D9ZiDj P+9qIdjp95vJNarBhzqPFJ9wHhoc0z6Gvz+B1wEQGKWo3I3A6KON0355Adm9Kem0IE K+FAjKY9AU4iU4/e6aPuCtgpgQplngWFZ2SmeNiU= To: Henrique de Moraes Holschuh , Darren Hart , Andy Shevchenko Cc: ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH 1/3] platform/x86: thinkpad_acpi: remove unused defines Date: Wed, 29 Jan 2020 21:43:36 +0100 Message-Id: <20200129204338.4055-2-linux@weissschuh.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200129204338.4055-1-linux@weissschuh.net> References: <20200129204338.4055-1-linux@weissschuh.net> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org They were never used. Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/thinkpad_acpi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index da794dcfdd92..2d3a99e3efb7 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -9323,9 +9323,6 @@ static struct ibm_struct mute_led_driver_data = { #define GET_STOP "BCSG" #define SET_STOP "BCSS" -#define START_ATTR "charge_start_threshold" -#define STOP_ATTR "charge_stop_threshold" - enum { BAT_ANY = 0, BAT_PRIMARY = 1, From patchwork Wed Jan 29 20:43:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 11356833 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0D6E112B for ; Wed, 29 Jan 2020 20:51:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F74D20702 for ; Wed, 29 Jan 2020 20:51:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="EWhJ9v1z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbgA2UvO (ORCPT ); Wed, 29 Jan 2020 15:51:14 -0500 Received: from ned.t-8ch.de ([212.47.237.191]:44320 "EHLO ned.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbgA2UvO (ORCPT ); Wed, 29 Jan 2020 15:51:14 -0500 X-Greylist: delayed 444 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 Jan 2020 15:51:13 EST From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1580330625; bh=WQpcTQM59ICWLbo7nhLJM/haB2c2OkM0qICuhuLiH4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EWhJ9v1zokSnYPGBPxBD2UCv3jZtj8tN+MLd2Uwthrn0J6F6KvR9IDyT6T7g3xpwz 1i9nmTfvCXY5WfoUWV18Rvx8gNkr7SHMHWHEcPTCNS4tw7GQY32mfHd/Jshs7Mw8wn NIodntsmFpEEUIarZyLnn9x3avTsjsTLXw3gZMLY= To: Henrique de Moraes Holschuh , Darren Hart , Andy Shevchenko Cc: ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH 2/3] platform/x86: thinkpad_acpi: use standard charge control attribute names Date: Wed, 29 Jan 2020 21:43:37 +0100 Message-Id: <20200129204338.4055-3-linux@weissschuh.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200129204338.4055-2-linux@weissschuh.net> References: <20200129204338.4055-1-linux@weissschuh.net> <20200129204338.4055-2-linux@weissschuh.net> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The standard attributes were only introduced after the ones from thinkpad_acpi in commit 813cab8f3994 ("power: supply: core: Add CHARGE_CONTROL_{START_THRESHOLD,END_THRESHOLD} properties"). Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/thinkpad_acpi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 2d3a99e3efb7..25e877789352 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -9608,40 +9608,40 @@ static ssize_t tpacpi_battery_show(int what, return sprintf(buf, "%d\n", ret); } -static ssize_t charge_start_threshold_show(struct device *device, +static ssize_t charge_control_start_threshold_show(struct device *device, struct device_attribute *attr, char *buf) { return tpacpi_battery_show(THRESHOLD_START, device, buf); } -static ssize_t charge_stop_threshold_show(struct device *device, +static ssize_t charge_control_stop_threshold_show(struct device *device, struct device_attribute *attr, char *buf) { return tpacpi_battery_show(THRESHOLD_STOP, device, buf); } -static ssize_t charge_start_threshold_store(struct device *dev, +static ssize_t charge_control_start_threshold_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { return tpacpi_battery_store(THRESHOLD_START, dev, buf, count); } -static ssize_t charge_stop_threshold_store(struct device *dev, +static ssize_t charge_control_stop_threshold_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { return tpacpi_battery_store(THRESHOLD_STOP, dev, buf, count); } -static DEVICE_ATTR_RW(charge_start_threshold); -static DEVICE_ATTR_RW(charge_stop_threshold); +static DEVICE_ATTR_RW(charge_control_start_threshold); +static DEVICE_ATTR_RW(charge_control_stop_threshold); static struct attribute *tpacpi_battery_attrs[] = { - &dev_attr_charge_start_threshold.attr, - &dev_attr_charge_stop_threshold.attr, + &dev_attr_charge_control_start_threshold.attr, + &dev_attr_charge_control_stop_threshold.attr, NULL, }; From patchwork Wed Jan 29 20:43:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 11356839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2C21112B for ; Wed, 29 Jan 2020 20:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A64B620716 for ; Wed, 29 Jan 2020 20:51:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Lo3CWjR9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727225AbgA2UvU (ORCPT ); Wed, 29 Jan 2020 15:51:20 -0500 Received: from ned.t-8ch.de ([212.47.237.191]:44316 "EHLO ned.t-8ch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgA2UvO (ORCPT ); Wed, 29 Jan 2020 15:51:14 -0500 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1580330625; bh=pD9DOP8o4NJhC/UfLuYM3FwTvcditszUCwuLr1jQOhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lo3CWjR9+PQBenoD9/aUC4/pQkmeeNo0mSR7gtu4Mr27/32rP6HNnF3bBvzIwddal AVjq3GFWu3rj3QbcU1DbDhvAPP/Rk/oaBtvk7/Lz1ojFclLcdPpouOdc1B9IhaGURT DtLRKedTklhZUD18jesweSiH97PFcxiqqYO9umoE= To: Henrique de Moraes Holschuh , Darren Hart , Andy Shevchenko Cc: ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH 3/3] platform/x86: thinkpad_acpi: restore old battery charge attributes Date: Wed, 29 Jan 2020 21:43:38 +0100 Message-Id: <20200129204338.4055-4-linux@weissschuh.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200129204338.4055-3-linux@weissschuh.net> References: <20200129204338.4055-1-linux@weissschuh.net> <20200129204338.4055-2-linux@weissschuh.net> <20200129204338.4055-3-linux@weissschuh.net> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Alias the new standard attributes to their previous names, preserving backwards compatibility. Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/thinkpad_acpi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 25e877789352..443b2b16dc11 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -9638,10 +9638,24 @@ static ssize_t charge_control_stop_threshold_store(struct device *dev, static DEVICE_ATTR_RW(charge_control_start_threshold); static DEVICE_ATTR_RW(charge_control_stop_threshold); +struct device_attribute dev_attr_charge_start_threshold = __ATTR( + charge_start_threshold, + 0644, + charge_control_start_threshold_show, + charge_control_start_threshold_store +); +struct device_attribute dev_attr_charge_stop_threshold = __ATTR( + charge_stop_threshold, + 0644, + charge_control_stop_threshold_show, + charge_control_stop_threshold_store +); static struct attribute *tpacpi_battery_attrs[] = { &dev_attr_charge_control_start_threshold.attr, &dev_attr_charge_control_stop_threshold.attr, + &dev_attr_charge_start_threshold.attr, + &dev_attr_charge_stop_threshold.attr, NULL, };