LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: linux-leds@vger.kernel.org, linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	kyungmin.park@samsung.com, pavel@ucw.cz, cooloney@gmail.com,
	rpurdie@rpsys.net, sakari.ailus@iki.fi, s.nawrocki@samsung.com,
	Jacek Anaszewski <j.anaszewski@samsung.com>
Subject: [PATCH/RFC v12 01/19] leds: flash: Remove synchronized flash strobe feature
Date: Wed, 04 Mar 2015 17:14:22 +0100	[thread overview]
Message-ID: <1425485680-8417-2-git-send-email-j.anaszewski@samsung.com> (raw)
In-Reply-To: <1425485680-8417-1-git-send-email-j.anaszewski@samsung.com>

Synchronized flash strobe feature has been considered not fitting
for LED subsystem sysfs interface and thus is being removed.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
---
 drivers/leds/led-class-flash.c  |   82 ---------------------------------------
 include/linux/led-class-flash.h |   14 -------
 include/linux/leds.h            |    1 -
 3 files changed, 97 deletions(-)

diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c
index 4a19fd4..3b25734 100644
--- a/drivers/leds/led-class-flash.c
+++ b/drivers/leds/led-class-flash.c
@@ -216,75 +216,6 @@ static ssize_t flash_fault_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(flash_fault);
 
-static ssize_t available_sync_leds_show(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct led_classdev *led_cdev = dev_get_drvdata(dev);
-	struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
-	char *pbuf = buf;
-	int i, buf_len;
-
-	buf_len = sprintf(pbuf, "[0: none] ");
-	pbuf += buf_len;
-
-	for (i = 0; i < fled_cdev->num_sync_leds; ++i) {
-		buf_len = sprintf(pbuf, "[%d: %s] ", i + 1,
-				  fled_cdev->sync_leds[i]->led_cdev.name);
-		pbuf += buf_len;
-	}
-
-	return sprintf(buf, "%s\n", buf);
-}
-static DEVICE_ATTR_RO(available_sync_leds);
-
-static ssize_t flash_sync_strobe_store(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t size)
-{
-	struct led_classdev *led_cdev = dev_get_drvdata(dev);
-	struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
-	unsigned long led_id;
-	ssize_t ret;
-
-	mutex_lock(&led_cdev->led_access);
-
-	if (led_sysfs_is_disabled(led_cdev)) {
-		ret = -EBUSY;
-		goto unlock;
-	}
-
-	ret = kstrtoul(buf, 10, &led_id);
-	if (ret)
-		goto unlock;
-
-	if (led_id > fled_cdev->num_sync_leds) {
-		ret = -ERANGE;
-		goto unlock;
-	}
-
-	fled_cdev->sync_led_id = led_id;
-
-	ret = size;
-unlock:
-	mutex_unlock(&led_cdev->led_access);
-	return ret;
-}
-
-static ssize_t flash_sync_strobe_show(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct led_classdev *led_cdev = dev_get_drvdata(dev);
-	struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
-	int sled_id = fled_cdev->sync_led_id;
-	char *sync_led_name = "none";
-
-	if (fled_cdev->sync_led_id > 0)
-		sync_led_name = (char *)
-			fled_cdev->sync_leds[sled_id - 1]->led_cdev.name;
-
-	return sprintf(buf, "[%d: %s]\n", sled_id, sync_led_name);
-}
-static DEVICE_ATTR_RW(flash_sync_strobe);
-
 static struct attribute *led_flash_strobe_attrs[] = {
 	&dev_attr_flash_strobe.attr,
 	NULL,
@@ -307,12 +238,6 @@ static struct attribute *led_flash_fault_attrs[] = {
 	NULL,
 };
 
-static struct attribute *led_flash_sync_strobe_attrs[] = {
-	&dev_attr_available_sync_leds.attr,
-	&dev_attr_flash_sync_strobe.attr,
-	NULL,
-};
-
 static const struct attribute_group led_flash_strobe_group = {
 	.attrs = led_flash_strobe_attrs,
 };
@@ -329,10 +254,6 @@ static const struct attribute_group led_flash_fault_group = {
 	.attrs = led_flash_fault_attrs,
 };
 
-static const struct attribute_group led_flash_sync_strobe_group = {
-	.attrs = led_flash_sync_strobe_attrs,
-};
-
 static void led_flash_resume(struct led_classdev *led_cdev)
 {
 	struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
@@ -361,9 +282,6 @@ static void led_flash_init_sysfs_groups(struct led_classdev_flash *fled_cdev)
 	if (ops->fault_get)
 		flash_groups[num_sysfs_groups++] = &led_flash_fault_group;
 
-	if (led_cdev->flags & LED_DEV_CAP_SYNC_STROBE)
-		flash_groups[num_sysfs_groups++] = &led_flash_sync_strobe_group;
-
 	led_cdev->groups = flash_groups;
 }
 
diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h
index 3b5b964..21ec91e 100644
--- a/include/linux/led-class-flash.h
+++ b/include/linux/led-class-flash.h
@@ -81,20 +81,6 @@ struct led_classdev_flash {
 
 	/* LED Flash class sysfs groups */
 	const struct attribute_group *sysfs_groups[LED_FLASH_MAX_SYSFS_GROUPS];
-
-	/* LEDs available for flash strobe synchronization */
-	struct led_classdev_flash **sync_leds;
-
-	/* Number of LEDs available for flash strobe synchronization */
-	int num_sync_leds;
-
-	/*
-	 * The identifier of the sub-led to synchronize the flash strobe with.
-	 * Identifiers start from 1, which reflects the first element from the
-	 * sync_leds array. 0 means that the flash strobe should not be
-	 * synchronized.
-	 */
-	u32 sync_led_id;
 };
 
 static inline struct led_classdev_flash *lcdev_to_flcdev(
diff --git a/include/linux/leds.h b/include/linux/leds.h
index f70f84f..351bba5 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -47,7 +47,6 @@ struct led_classdev {
 #define SET_BRIGHTNESS_ASYNC	(1 << 21)
 #define SET_BRIGHTNESS_SYNC	(1 << 22)
 #define LED_DEV_CAP_FLASH	(1 << 23)
-#define LED_DEV_CAP_SYNC_STROBE	(1 << 24)
 
 	/* Set LED brightness level */
 	/* Must not sleep, use a workqueue if needed */
-- 
1.7.9.5


  reply	other threads:[~2015-03-04 16:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 16:14 [PATCH/RFC v12 00/19] LED / flash API integration Jacek Anaszewski
2015-03-04 16:14 ` Jacek Anaszewski [this message]
2015-03-09 23:23   ` [PATCH/RFC v12 01/19] leds: flash: Remove synchronized flash strobe feature Bryan Wu
2015-03-04 16:14 ` [PATCH/RFC v12 02/19] leds: flash: document sysfs interface Jacek Anaszewski
2015-03-10  0:17   ` Bryan Wu
2015-03-04 16:14 ` [PATCH/RFC v12 03/19] Documentation: leds: Add description of LED Flash class extension Jacek Anaszewski
2015-03-10  0:23   ` Bryan Wu
2015-03-04 16:14 ` [PATCH/RFC v12 04/19] dt-binding: leds: Add common LED DT bindings macros Jacek Anaszewski
2015-03-05  7:56   ` Jacek Anaszewski
2015-03-10  0:33     ` Bryan Wu
2015-03-04 16:14 ` [PATCH/RFC v12 05/19] mfd: max77693: Modify flash cell name identifiers Jacek Anaszewski
2015-03-09  9:36   ` Lee Jones
2015-03-04 16:14 ` [PATCH/RFC v12 06/19] mfd: max77693: Remove struct max77693_led_platform_data Jacek Anaszewski
2015-03-09  9:35   ` Lee Jones
2015-03-04 16:14 ` [PATCH/RFC v12 07/19] mfd: max77693: add TORCH_IOUT_MASK macro Jacek Anaszewski
2015-03-09  9:36   ` Lee Jones
2015-03-04 16:14 ` [PATCH/RFC v12 08/19] mfd: max77693: Adjust FLASH_EN_SHIFT and TORCH_EN_SHIFT macros Jacek Anaszewski
2015-03-09  9:35   ` Lee Jones
2015-03-04 16:14 ` [PATCH/RFC v12 09/19] leds: Add support for max77693 mfd flash cell Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 10/19] DT: Add documentation for the mfd Maxim max77693 Jacek Anaszewski
2015-03-09 10:54   ` Sakari Ailus
2015-03-09 12:19     ` Jacek Anaszewski
2015-03-09 12:37       ` Sakari Ailus
2015-03-09 13:45         ` Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 11/19] leds: Add driver for AAT1290 current regulator Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 12/19] of: Add Skyworks Solutions, Inc. vendor prefix Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 13/19] DT: Add documentation for the Skyworks AAT1290 Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 14/19] exynos4-is: Add support for v4l2-flash subdevs Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 15/19] media: Add registration helpers for V4L2 flash sub-devices Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 16/19] Documentation: leds: Add description of v4l2-flash sub-device Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 17/19] DT: Add documentation for exynos4-is 'flashes' property Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 18/19] leds: max77693: add support for V4L2 Flash sub-device Jacek Anaszewski
2015-03-04 16:14 ` [PATCH/RFC v12 19/19] leds: aat1290: " Jacek Anaszewski

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=1425485680-8417-2-git-send-email-j.anaszewski@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rpurdie@rpsys.net \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    --subject='Re: [PATCH/RFC v12 01/19] leds: flash: Remove synchronized flash strobe feature' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).