From: Sebastian Reichel <sre@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: NeilBrown <neil@brown.name>, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Russell King <linux@armlinux.org.uk>,
Marek Belisko <marek@goldelico.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org, letux-kernel@openphoenux.org,
notasas@gmail.com, linux-omap@vger.kernel.org
Subject: Re: [PATCH v5 1/3] drivers:power:twl4030-charger: remove nonstandard max_current sysfs attribute
Date: Wed, 7 Jun 2017 22:23:14 +0200 [thread overview]
Message-ID: <20170607202313.qko7tgzocfhwbdwv@earth> (raw)
In-Reply-To: <2cfdb1799219d883cde31779e97d570dc003f8cf.1495363097.git.hns@goldelico.com>
[-- Attachment #1: Type: text/plain, Size: 5128 bytes --]
Hi,
On Sun, May 21, 2017 at 12:38:16PM +0200, H. Nikolaus Schaller wrote:
> Since we now support the standard 'input_current_limit' property by
>
> commit 3fb319c2cdcd ("power: supply: twl4030-charger: add writable INPUT_CURRENT_LIMIT property")
>
> we can now remove the nonstandard 'max_current' sysfs attribute.
>
> See Documentation/power/power_supply_class.txt line 125
>
> Both are functionally equivalent. From ABI point of view it is just a rename
> of the property.
>
> This also removes the entry in Documentation/ABI/testing/sysfs-class-power-twl4030
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Thanks, queued.
-- Sebastian
> ---
> .../ABI/testing/sysfs-class-power-twl4030 | 17 ------
> drivers/power/supply/twl4030_charger.c | 63 ----------------------
> 2 files changed, 80 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-power-twl4030 b/Documentation/ABI/testing/sysfs-class-power-twl4030
> index be26af0f1895..b4fd32d210c5 100644
> --- a/Documentation/ABI/testing/sysfs-class-power-twl4030
> +++ b/Documentation/ABI/testing/sysfs-class-power-twl4030
> @@ -1,20 +1,3 @@
> -What: /sys/class/power_supply/twl4030_ac/max_current
> - /sys/class/power_supply/twl4030_usb/max_current
> -Description:
> - Read/Write limit on current which may
> - be drawn from the ac (Accessory Charger) or
> - USB port.
> -
> - Value is in micro-Amps.
> -
> - Value is set automatically to an appropriate
> - value when a cable is plugged or unplugged.
> -
> - Value can the set by writing to the attribute.
> - The change will only persist until the next
> - plug event. These event are reported via udev.
> -
> -
> What: /sys/class/power_supply/twl4030_usb/mode
> Description:
> Changing mode for USB port.
> diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c
> index 2f82d0e9ec1b..785a07bc4f39 100644
> --- a/drivers/power/supply/twl4030_charger.c
> +++ b/drivers/power/supply/twl4030_charger.c
> @@ -624,63 +624,6 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
> return IRQ_HANDLED;
> }
>
> -/*
> - * Provide "max_current" attribute in sysfs.
> - */
> -static ssize_t
> -twl4030_bci_max_current_store(struct device *dev, struct device_attribute *attr,
> - const char *buf, size_t n)
> -{
> - struct twl4030_bci *bci = dev_get_drvdata(dev->parent);
> - int cur = 0;
> - int status = 0;
> - status = kstrtoint(buf, 10, &cur);
> - if (status)
> - return status;
> - if (cur < 0)
> - return -EINVAL;
> - if (dev == &bci->ac->dev)
> - bci->ac_cur = cur;
> - else
> - bci->usb_cur_target = cur;
> -
> - twl4030_charger_update_current(bci);
> - return n;
> -}
> -
> -/*
> - * sysfs max_current show
> - */
> -static ssize_t twl4030_bci_max_current_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - int status = 0;
> - int cur = -1;
> - u8 bcictl1;
> - struct twl4030_bci *bci = dev_get_drvdata(dev->parent);
> -
> - if (dev == &bci->ac->dev) {
> - if (!bci->ac_is_active)
> - cur = bci->ac_cur;
> - } else {
> - if (bci->ac_is_active)
> - cur = bci->usb_cur_target;
> - }
> - if (cur < 0) {
> - cur = twl4030bci_read_adc_val(TWL4030_BCIIREF1);
> - if (cur < 0)
> - return cur;
> - status = twl4030_bci_read(TWL4030_BCICTL1, &bcictl1);
> - if (status < 0)
> - return status;
> - cur = regval2ua(cur, bcictl1 & TWL4030_CGAIN);
> - }
> - return scnprintf(buf, PAGE_SIZE, "%u\n", cur);
> -}
> -
> -static DEVICE_ATTR(max_current, 0644, twl4030_bci_max_current_show,
> - twl4030_bci_max_current_store);
> -
> static void twl4030_bci_usb_work(struct work_struct *data)
> {
> struct twl4030_bci *bci = container_of(data, struct twl4030_bci, work);
> @@ -1111,14 +1054,10 @@ static int twl4030_bci_probe(struct platform_device *pdev)
> dev_warn(&pdev->dev, "failed to unmask interrupts: %d\n", ret);
>
> twl4030_charger_update_current(bci);
> - if (device_create_file(&bci->usb->dev, &dev_attr_max_current))
> - dev_warn(&pdev->dev, "could not create sysfs file\n");
> if (device_create_file(&bci->usb->dev, &dev_attr_mode))
> dev_warn(&pdev->dev, "could not create sysfs file\n");
> if (device_create_file(&bci->ac->dev, &dev_attr_mode))
> dev_warn(&pdev->dev, "could not create sysfs file\n");
> - if (device_create_file(&bci->ac->dev, &dev_attr_max_current))
> - dev_warn(&pdev->dev, "could not create sysfs file\n");
>
> twl4030_charger_enable_ac(bci, true);
> if (!IS_ERR_OR_NULL(bci->transceiver))
> @@ -1150,9 +1089,7 @@ static int twl4030_bci_remove(struct platform_device *pdev)
>
> iio_channel_release(bci->channel_vac);
>
> - device_remove_file(&bci->usb->dev, &dev_attr_max_current);
> device_remove_file(&bci->usb->dev, &dev_attr_mode);
> - device_remove_file(&bci->ac->dev, &dev_attr_max_current);
> device_remove_file(&bci->ac->dev, &dev_attr_mode);
> /* mask interrupts */
> twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff,
> --
> 2.12.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-06-07 20:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-21 10:38 [PATCH v5 0/3] More fixes for twl4030 charger H. Nikolaus Schaller
2017-05-21 10:38 ` [PATCH v5 1/3] drivers:power:twl4030-charger: remove nonstandard max_current sysfs attribute H. Nikolaus Schaller
2017-06-07 20:23 ` Sebastian Reichel [this message]
2017-05-21 10:38 ` [PATCH v5 2/3] ARM: dts: twl4030: Add missing madc reference for bci subnode H. Nikolaus Schaller
2017-06-06 7:23 ` Tony Lindgren
2017-06-07 9:50 ` H. Nikolaus Schaller
[not found] ` <cover.1495363097.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2017-05-21 10:38 ` [PATCH v5 3/3] drivers:power:twl4030-charger: add deferred probing for phy and iio H. Nikolaus Schaller
[not found] ` <6ed105f6c9c21c24184913a7be9e665453549d79.1495363097.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2017-06-07 20:44 ` Sebastian Reichel
2017-06-09 6:05 ` H. Nikolaus Schaller
2017-06-09 16:25 ` Grygorii Strashko
2017-06-10 4:59 ` H. Nikolaus Schaller
2017-06-12 16:24 ` Grygorii Strashko
2017-06-12 17:02 ` H. Nikolaus Schaller
2017-06-12 18:42 ` Grygorii Strashko
[not found] ` <a91d2ad7-5985-789e-e4ad-04057dfdd8a3-l0cyMroinI0@public.gmane.org>
2017-06-12 20:38 ` H. Nikolaus Schaller
2017-06-03 6:01 ` [PATCH v5 0/3] More fixes for twl4030 charger H. Nikolaus Schaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170607202313.qko7tgzocfhwbdwv@earth \
--to=sre@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hns@goldelico.com \
--cc=letux-kernel@openphoenux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=marek@goldelico.com \
--cc=mark.rutland@arm.com \
--cc=neil@brown.name \
--cc=notasas@gmail.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox