From patchwork Fri Aug 9 15:47:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 266096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-yh0-x23f.google.com (mail-yh0-x23f.google.com [IPv6:2607:f8b0:4002:c01::23f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id F09352C009F for ; Sat, 10 Aug 2013 01:33:17 +1000 (EST) Received: by mail-yh0-f63.google.com with SMTP id z12sf1192296yhz.18 for ; Fri, 09 Aug 2013 08:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=m9nHF+IiXKf4F1dVnpUmfo9lNfC1Qbx4BUv5HyofRI8=; b=MLh+0icM8se8jtWs6ZQP5/0bMQ/IJIVwqasHvn51u+roCJZl2C/4OxFuKx93mdbrCG vx/9lgnN1xFC4bqMLYiKLstgMLBZi2YujuepYSjKvXnV2Mk/uTRN4mRYbOh9Rdmvyw+w C9MPTSf1ZV+vUdk7TSF/FyCD/UVpy0t/hY3CM/U9oNEEaAyxThgJDM0alDVjndSSy8Qs jvZ8yMhXzzvlh3NK6YRp7A5XxUcPwYpbXOimuP7gvxsJj1a9W7T/Ar/tW78r6Knjo8Gj EKZlsNH5S0QR8EYkv630x4FIh8A+gKR+aWDP5OHL+dpi7SzTfpPsEMatgJ1fGXmFzbDD Z2cQ== X-Received: by 10.49.96.72 with SMTP id dq8mr384414qeb.40.1376062393669; Fri, 09 Aug 2013 08:33:13 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.49.25.132 with SMTP id c4ls1577645qeg.86.gmail; Fri, 09 Aug 2013 08:33:13 -0700 (PDT) X-Received: by 10.236.126.244 with SMTP id b80mr5695438yhi.31.1376062393184; Fri, 09 Aug 2013 08:33:13 -0700 (PDT) Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com. [216.228.121.65]) by gmr-mx.google.com with ESMTPS id c45si1165415yhm.2.2013.08.09.08.33.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 08:33:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.65 as permitted sender) client-ip=216.228.121.65; Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Fri, 09 Aug 2013 08:33:10 -0700 Received: from hqemhub01.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Fri, 09 Aug 2013 08:33:12 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Fri, 09 Aug 2013 08:33:12 -0700 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server id 8.3.298.1; Fri, 9 Aug 2013 08:33:11 -0700 Received: from thelma.nvidia.com (Not Verified[172.16.212.77]) by hqnvemgw01.nvidia.com with MailMarshal (v7,1,2,5326) id ; Fri, 09 Aug 2013 08:33:11 -0700 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by thelma.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id r79FX53W019216; Fri, 9 Aug 2013 08:33:06 -0700 (PDT) From: Laxman Dewangan To: CC: , , , , , , , , , , , , , , Laxman Dewangan Subject: [rtc-linux] [PATCH] drivers/rtc/rtc-palmas.c: rename charging dt property name Date: Fri, 9 Aug 2013 21:17:10 +0530 Message-ID: <1376063230-22578-1-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 MIME-Version: 1.0 X-Original-Sender: ldewangan@nvidia.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.65 as permitted sender) smtp.mail=ldewangan@nvidia.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Renaming the charging property names to have more meaningful: Renaming property "ti,back-battery-charge-enable" to "ti,backup-battery-chargeable" to tells OS that attahced battery is chargeable and OS can do charging. Renaming property "ti,back-battery-charge-low-current" to "ti,backup-battery-charge-high-current" for safe configuration as maximum charging current of battery depends on battery type and overcurrent charging can damage the battery. So enable the high current charging only if this property is available. Signed-off-by: Laxman Dewangan Acked-by: Kumar Gala --- The patch V4 version of the change [PATCH V4] drivers/rtc/rtc-palmas.c: support for backup battery charging is already applied but still the discussion is going on the property name. To correct the property name, I am sending this patch on top of above patch as per discussion on above patch. .../devicetree/bindings/rtc/rtc-palmas.txt | 21 +++++++++++-------- drivers/rtc/rtc-palmas.c | 14 ++++++------ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/rtc/rtc-palmas.txt b/Documentation/devicetree/bindings/rtc/rtc-palmas.txt index 41bb445..8ef7660 100644 --- a/Documentation/devicetree/bindings/rtc/rtc-palmas.txt +++ b/Documentation/devicetree/bindings/rtc/rtc-palmas.txt @@ -7,13 +7,16 @@ Required properties: - interrupts: Interrupt number of RTC submodule on device. Optional properties: -- ti,back-battery-charge-enable: The Palmas series device like TPS65913 or - TPS80036 supports the battery backup for powering the RTC when main - battery is removed or in very low power state. This flag will enable - the backup battery charging. -- ti,back-battery-charge-low-current: Configure lower charging current. Device - supports the charging current as < 100mA or >100mA. Low current will - set as <100mA. +- ti,backup-battery-chargeable: The Palmas series device like TPS65913 or + TPS80036 supports the backup battery for powering the RTC when main + battery is removed or in very low power state. The backup battery + can be chargeable or non-chargeable. This flag will tells whether + battery is chargeable or not. If charging battery then driver can + enable the charging. +- ti,backup-battery-charge-high-current: Enable high current charging in + backup battery. Device supports the < 100mA and > 100mA charging. + The high current will be > 100mA. Absence of this property will + charge battery to lower current i.e. < 100mA. Example: palmas: tps65913@58 { @@ -22,8 +25,8 @@ Example: compatible = "ti,palmas-rtc"; interrupt-parent = <&palmas>; interrupts = <8 0>; - ti,back-battery-charge-enable; - ti,back-battery-charge-low-current; + ti,backup-battery-chargeable; + ti,backup-battery-charge-high-current; }; ... }; diff --git a/drivers/rtc/rtc-palmas.c b/drivers/rtc/rtc-palmas.c index adb6e71..fffb7d3 100644 --- a/drivers/rtc/rtc-palmas.c +++ b/drivers/rtc/rtc-palmas.c @@ -239,13 +239,13 @@ static int palmas_rtc_probe(struct platform_device *pdev) struct palmas_rtc *palmas_rtc = NULL; int ret; bool enable_bb_charging = false; - bool low_bb_charging; + bool high_bb_charging; if (pdev->dev.of_node) { enable_bb_charging = of_property_read_bool(pdev->dev.of_node, - "ti,back-battery-charge-enable"); - low_bb_charging = of_property_read_bool(pdev->dev.of_node, - "ti,back-battery-charge-low-current"); + "ti,backup-battery-chargeable"); + high_bb_charging = of_property_read_bool(pdev->dev.of_node, + "ti,backup-battery-charge-high-current"); } palmas_rtc = devm_kzalloc(&pdev->dev, sizeof(struct palmas_rtc), @@ -264,10 +264,10 @@ static int palmas_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, palmas_rtc); if (enable_bb_charging) { - unsigned reg = 0; + unsigned reg = PALMAS_BACKUP_BATTERY_CTRL_BBS_BBC_LOW_ICHRG; - if (low_bb_charging) - reg |= PALMAS_BACKUP_BATTERY_CTRL_BBS_BBC_LOW_ICHRG; + if (high_bb_charging) + reg = 0; ret = palmas_update_bits(palmas, PALMAS_PMU_CONTROL_BASE, PALMAS_BACKUP_BATTERY_CTRL,