linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <jhovold@gmail.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: Rob Landley <rob@landley.net>, Richard Purdie <rpurdie@rpsys.net>,
	Jonathan Cameron <jic23@cam.ac.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <jhovold@gmail.com>
Subject: [PATCH 2/2] mfd: lm3533: remove boost attributes
Date: Thu, 10 May 2012 14:11:29 +0200	[thread overview]
Message-ID: <1336651889-6425-2-git-send-email-jhovold@gmail.com> (raw)
In-Reply-To: <1336651889-6425-1-git-send-email-jhovold@gmail.com>

Remove boost-frequency and ovp attributes, which can be set through
platform data, from sysfs.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 .../ABI/testing/sysfs-bus-i2c-devices-lm3533       |   23 -----
 drivers/mfd/lm3533-core.c                          |   88 --------------------
 2 files changed, 0 insertions(+), 111 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-i2c-devices-lm3533 b/Documentation/ABI/testing/sysfs-bus-i2c-devices-lm3533
index 5700721..1b62230 100644
--- a/Documentation/ABI/testing/sysfs-bus-i2c-devices-lm3533
+++ b/Documentation/ABI/testing/sysfs-bus-i2c-devices-lm3533
@@ -1,26 +1,3 @@
-What:		/sys/bus/i2c/devices/.../boost_freq
-Date:		April 2012
-KernelVersion:	3.5
-Contact:	Johan Hovold <jhovold@gmail.com>
-Description:
-		Set the boost converter switching frequency (0, 1), where
-
-		0 -  500Hz
-		1 - 1000Hz
-
-What:		/sys/bus/i2c/devices/.../boost_ovp
-Date:		April 2012
-KernelVersion:	3.5
-Contact:	Johan Hovold <jhovold@gmail.com>
-Description:
-		Set the boost converter over-voltage protection threshold
-		(0..3), where
-
-		0 - 16V
-		1 - 24V
-		2 - 32V
-		3 - 40V
-
 What:		/sys/bus/i2c/devices/.../output_hvled[n]
 Date:		April 2012
 KernelVersion:	3.5
diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c
index 053438c..d670543 100644
--- a/drivers/mfd/lm3533-core.c
+++ b/drivers/mfd/lm3533-core.c
@@ -26,11 +26,9 @@
 #include <linux/mfd/lm3533.h>
 
 
-#define LM3533_BOOST_OVP_MAX		0x03
 #define LM3533_BOOST_OVP_MASK		0x06
 #define LM3533_BOOST_OVP_SHIFT		1
 
-#define LM3533_BOOST_FREQ_MAX		0x01
 #define LM3533_BOOST_FREQ_MASK		0x01
 #define LM3533_BOOST_FREQ_SHIFT		0
 
@@ -253,96 +251,12 @@ struct lm3533_device_attribute {
 		struct {
 			u8 id;
 		} output;
-		struct {
-			u8 reg;
-			u8 shift;
-			u8 mask;
-			u8 max;
-		} generic;
 	} u;
 };
 
 #define to_lm3533_dev_attr(_attr) \
 	container_of(_attr, struct lm3533_device_attribute, dev_attr)
 
-static ssize_t show_lm3533_reg(struct device *dev,
-				struct device_attribute *attr, char *buf)
-{
-	struct lm3533 *lm3533 = dev_get_drvdata(dev);
-	struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(attr);
-	u8 val;
-	int ret;
-
-	ret = lm3533_read(lm3533, lattr->u.generic.reg, &val);
-	if (ret)
-		return ret;
-
-	val = (val & lattr->u.generic.mask) >> lattr->u.generic.shift;
-
-	return scnprintf(buf, PAGE_SIZE, "%u\n", val);
-}
-
-static ssize_t store_lm3533_reg(struct device *dev,
-						struct device_attribute *attr,
-						const char *buf, size_t len)
-{
-	struct lm3533 *lm3533 = dev_get_drvdata(dev);
-	struct lm3533_device_attribute *lattr = to_lm3533_dev_attr(attr);
-	u8 val;
-	int ret;
-
-	if (kstrtou8(buf, 0, &val) || val > lattr->u.generic.max)
-		return -EINVAL;
-
-	val = val << lattr->u.generic.shift;
-	ret = lm3533_update(lm3533, lattr->u.generic.reg, val,
-							lattr->u.generic.mask);
-	if (ret)
-		return ret;
-
-	return len;
-}
-
-#define GENERIC_ATTR(_reg, _max, _mask, _shift) \
-	{ .reg		= _reg, \
-	  .max		= _max, \
-	  .mask		= _mask, \
-	  .shift	= _shift }
-
-#define LM3533_GENERIC_ATTR(_name, _mode, _show, _store, _type,	\
-						_reg, _max, _mask, _shift) \
-	struct lm3533_device_attribute lm3533_dev_attr_##_name = { \
-		.dev_attr	= __ATTR(_name, _mode, _show, _store), \
-		.type		= _type, \
-		.u.generic	= GENERIC_ATTR(_reg, _max, _mask, _shift) }
-
-#define LM3533_GENERIC_ATTR_RW(_name, _type, _reg, _max, _mask, _shift) \
-	LM3533_GENERIC_ATTR(_name, S_IRUGO | S_IWUSR, \
-					show_lm3533_reg, store_lm3533_reg, \
-					_type, _reg, _max, _mask, _shift)
-
-#define LM3533_BOOST_ATTR_RW(_name, _NAME) \
-	LM3533_GENERIC_ATTR_RW(_name, LM3533_ATTR_TYPE_BACKLIGHT, \
-				LM3533_REG_BOOST_PWM, LM3533_##_NAME##_MAX, \
-				LM3533_##_NAME##_MASK, LM3533_##_NAME##_SHIFT)
-/*
- * Boost Over Voltage Protection Select
- *
- *   0 - 16 V (default)
- *   1 - 24 V
- *   2 - 32 V
- *   3 - 40 V
- */
-static LM3533_BOOST_ATTR_RW(boost_ovp, BOOST_OVP);
-
-/*
- * Boost Frequency Select
- *
- *   0 - 500 kHz (default)
- *   1 - 1 MHz
- */
-static LM3533_BOOST_ATTR_RW(boost_freq, BOOST_FREQ);
-
 static ssize_t show_output(struct device *dev,
 				struct device_attribute *attr, char *buf)
 {
@@ -432,8 +346,6 @@ static LM3533_OUTPUT_LVLED_ATTR_RW(4);
 static LM3533_OUTPUT_LVLED_ATTR_RW(5);
 
 static struct attribute *lm3533_attributes[] = {
-	&lm3533_dev_attr_boost_freq.dev_attr.attr,
-	&lm3533_dev_attr_boost_ovp.dev_attr.attr,
 	&lm3533_dev_attr_output_hvled1.dev_attr.attr,
 	&lm3533_dev_attr_output_hvled2.dev_attr.attr,
 	&lm3533_dev_attr_output_lvled1.dev_attr.attr,
-- 
1.7.8.5


  reply	other threads:[~2012-05-10 12:11 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 15:30 [PATCH 0/4] mfd: add LM3533 lighting-power chip driver Johan Hovold
2012-04-20 15:30 ` [PATCH 1/4] mfd: add LM3533 lighting-power core driver Johan Hovold
2012-04-26 12:41   ` Mark Brown
2012-05-03 10:15     ` Johan Hovold
2012-05-03 10:22     ` Johan Hovold
2012-04-20 15:30 ` [PATCH 2/4] misc: add LM3533 ambient light sensor driver Johan Hovold
2012-04-20 15:57   ` Greg Kroah-Hartman
2012-04-20 17:28     ` Johan Hovold
2012-04-20 17:37       ` Greg Kroah-Hartman
2012-04-26 11:52         ` Johan Hovold
2012-04-20 15:30 ` [PATCH 3/4] leds: add LM3533 LED driver Johan Hovold
2012-04-20 16:10   ` Arnd Bergmann
2012-04-20 16:45     ` Johan Hovold
2012-04-20 15:30 ` [PATCH 4/4] backlight: add LM3533 backlight driver Johan Hovold
2012-05-03 10:26 ` [PATCH v2 0/4] mfd: add LM3533 lighting-power chip driver Johan Hovold
2012-05-03 10:26   ` [PATCH v2 1/4] mfd: add LM3533 lighting-power core driver Johan Hovold
2012-05-03 10:38     ` Mark Brown
2012-05-03 11:28       ` Johan Hovold
2012-05-03 11:38         ` Mark Brown
2012-05-03 15:00           ` Johan Hovold
2012-05-03 15:24             ` Mark Brown
2012-05-03 16:54               ` Johan Hovold
2012-05-03 16:57                 ` Mark Brown
2012-05-03 17:14                   ` Johan Hovold
2012-05-03 17:23                     ` Mark Brown
2012-05-03 17:31                       ` Johan Hovold
2012-05-09 14:42     ` Samuel Ortiz
2012-05-10 12:07       ` Johan Hovold
2012-05-10 12:11         ` [PATCH 1/2] mfd: lm3533: add boost frequency and ovp to platform data Johan Hovold
2012-05-10 12:11           ` Johan Hovold [this message]
2012-05-10 17:18         ` [PATCH 0/2] mfd: lm3533: update max-current interface Johan Hovold
2012-05-10 17:18           ` [PATCH 1/2] mfd: lm3533: remove unused max-current function Johan Hovold
2012-05-10 17:18           ` [PATCH 2/2] mfd: lm3533: use SI-units for max-current interface Johan Hovold
2012-05-11 13:32         ` [PATCH v2 1/4] mfd: add LM3533 lighting-power core driver Samuel Ortiz
2012-05-03 10:26   ` [PATCH v2 2/4] iio: add LM3533 ambient light sensor driver Johan Hovold
2012-05-03 11:40     ` Jonathan Cameron
2012-05-03 16:36       ` Johan Hovold
2012-05-08 13:47         ` Jonathan Cameron
2012-05-15 16:44           ` Johan Hovold
2012-05-15 20:00             ` Jonathan Cameron
2012-05-16 13:05               ` Johan Hovold
2012-05-16 14:21                 ` Jonathan Cameron
2012-05-18 12:27                   ` Johan Hovold
2012-05-18 17:34                     ` Jonathan Cameron
2012-05-18 17:57                       ` Johan Hovold
2012-05-19  8:04                         ` Jonathan Cameron
2012-05-15 16:46     ` [PATCH v3] iio: add LM3533 ambient-light-sensor driver Johan Hovold
2012-05-15 19:27       ` Andrew Morton
2012-05-15 20:00         ` Johan Hovold
2012-05-15 20:16           ` Jonathan Cameron
2012-05-18 13:07       ` [PATCH v4] " Johan Hovold
2012-05-19  8:48         ` Jonathan Cameron
2012-05-19 16:30           ` Johan Hovold
2012-05-19 13:26             ` Jonathan Cameron
2012-05-21  9:50           ` Johan Hovold
2012-05-21 16:37             ` Jonathan Cameron
2012-05-21 22:07               ` Johan Hovold
2012-05-22  7:13                 ` Jonathan Cameron
2012-05-22  9:09                   ` Johan Hovold
2012-05-22  9:15                     ` Jonathan Cameron
2012-05-22  7:45               ` Michael Hennerich
2012-05-22  7:49                 ` Jonathan Cameron
2012-05-22  8:11                   ` Michael Hennerich
2012-05-22  8:20                     ` Jonathan Cameron
2012-05-21 12:18         ` [PATCH v5] " Johan Hovold
2012-05-22  9:19           ` Jonathan Cameron
2012-05-22  9:40             ` Johan Hovold
2012-05-22 13:55               ` Greg Kroah-Hartman
2012-06-05  4:11               ` Greg Kroah-Hartman
2012-05-03 10:26   ` [PATCH v2 3/4] leds: add LM3533 LED driver Johan Hovold
2012-05-03 10:43     ` Mark Brown
2012-05-03 11:50       ` Johan Hovold
2012-05-03 14:51         ` Mark Brown
2012-05-03 16:46           ` Johan Hovold
2012-05-10 18:27     ` [PATCH v3] " Johan Hovold
2012-05-10 18:48       ` Andrew Morton
2012-05-11  9:54         ` Johan Hovold
2012-05-11 22:24           ` Andrew Morton
2012-05-14 10:25             ` Johan Hovold
2012-05-14 10:31       ` [PATCH v4] " Johan Hovold
2012-05-03 10:26   ` [PATCH v2 4/4] backlight: add LM3533 backlight driver Johan Hovold
2012-05-10 18:29     ` [PATCH v3] " Johan Hovold
2012-05-15 19:13       ` [PATCH v4] " Johan Hovold

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=1336651889-6425-2-git-send-email-jhovold@gmail.com \
    --to=jhovold@gmail.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@cam.ac.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=rpurdie@rpsys.net \
    --cc=sameo@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).