* [PATCH 1/2] mfd/mc13783: new function exposing flags
@ 2010-08-02 9:14 Uwe Kleine-König
2010-08-02 9:14 ` [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly Uwe Kleine-König
2010-08-02 10:01 ` [PATCH 1/2] mfd/mc13783: new function exposing flags Samuel Ortiz
0 siblings, 2 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2010-08-02 9:14 UTC (permalink / raw)
To: linux-kernel, Samuel Ortiz, lm-sensors
Cc: Samuel Ortiz, Uwe Kleine-König, Andrew Morton,
Alberto Panizzo, Sascha Hauer
This is needed for the mc13783-adc driver to decide if a touch screen is
connected. If so some channels are not available as generic hwmon inputs.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/mfd/mc13783-core.c | 6 ++++++
include/linux/mfd/mc13783.h | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/mc13783-core.c b/drivers/mfd/mc13783-core.c
index ead84e4..a4fa191 100644
--- a/drivers/mfd/mc13783-core.c
+++ b/drivers/mfd/mc13783-core.c
@@ -226,6 +226,12 @@ int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset,
}
EXPORT_SYMBOL(mc13783_reg_rmw);
+int mc13783_get_flags(struct mc13783 *mc13783)
+{
+ return mc13783->flags;
+}
+EXPORT_SYMBOL(mc13783_get_flags);
+
int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
{
int ret;
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 4a894f6..0fa44fb 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -21,6 +21,8 @@ int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val);
int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset,
u32 mask, u32 val);
+int mc13783_get_flags(struct mc13783 *mc13783);
+
int mc13783_irq_request(struct mc13783 *mc13783, int irq,
irq_handler_t handler, const char *name, void *dev);
int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly
2010-08-02 9:14 [PATCH 1/2] mfd/mc13783: new function exposing flags Uwe Kleine-König
@ 2010-08-02 9:14 ` Uwe Kleine-König
2010-08-02 10:04 ` Samuel Ortiz
2010-08-02 10:01 ` [PATCH 1/2] mfd/mc13783: new function exposing flags Samuel Ortiz
1 sibling, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2010-08-02 9:14 UTC (permalink / raw)
To: linux-kernel, Samuel Ortiz, lm-sensors
Cc: Uwe Kleine-König, Hans de Goede, Mark Brown, Tejun Heo,
Jean Delvare
There is a shiny new mc13783 API function that can be used instead.
While at it refactor the code a bit to reduce code duplication a bit.
This removes the last user of <linux/mfd/mc13783-private.h> and so this
include file can go away.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/hwmon/mc13783-adc.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
index ce3c7bc..d5226c9 100644
--- a/drivers/hwmon/mc13783-adc.c
+++ b/drivers/hwmon/mc13783-adc.c
@@ -18,7 +18,7 @@
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <linux/mfd/mc13783-private.h>
+#include <linux/mfd/mc13783.h>
#include <linux/platform_device.h>
#include <linux/hwmon-sysfs.h>
#include <linux/kernel.h>
@@ -144,6 +144,14 @@ static const struct attribute_group mc13783_group_ts = {
.attrs = mc13783_attr_ts,
};
+static int mc13783_adc_use_touchscreen(struct platform_device *pdev)
+{
+ struct mc13783_adc_priv *priv = platform_get_drvdata(pdev);
+ unsigned flags = mc13783_get_flags(priv->mc13783);
+
+ return flags & MC13783_USE_TOUCHSCREEN;
+}
+
static int __init mc13783_adc_probe(struct platform_device *pdev)
{
struct mc13783_adc_priv *priv;
@@ -162,10 +170,11 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
if (ret)
goto out_err_create1;
- if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
+ if (!mc13783_adc_use_touchscreen(pdev)) {
ret = sysfs_create_group(&pdev->dev.kobj, &mc13783_group_ts);
if (ret)
goto out_err_create2;
+ }
priv->hwmon_dev = hwmon_device_register(&pdev->dev);
if (IS_ERR(priv->hwmon_dev)) {
@@ -180,7 +189,7 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
out_err_register:
- if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
+ if (!mc13783_adc_use_touchscreen(pdev))
sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
out_err_create2:
@@ -199,7 +208,7 @@ static int __devexit mc13783_adc_remove(struct platform_device *pdev)
hwmon_device_unregister(priv->hwmon_dev);
- if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
+ if (!mc13783_adc_use_touchscreen(pdev))
sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
sysfs_remove_group(&pdev->dev.kobj, &mc13783_group);
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly
2010-08-02 9:14 ` [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly Uwe Kleine-König
@ 2010-08-02 10:04 ` Samuel Ortiz
2010-08-02 12:52 ` Uwe Kleine-König
2010-08-02 13:48 ` [PATCH 3/2] mfd/mc13783: get rid of now unused private header Uwe Kleine-König
0 siblings, 2 replies; 7+ messages in thread
From: Samuel Ortiz @ 2010-08-02 10:04 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-kernel, lm-sensors, Hans de Goede, Mark Brown, Tejun Heo,
Jean Delvare
Hi Uwe,
On Mon, Aug 02, 2010 at 11:14:18AM +0200, Uwe Kleine-König wrote:
> There is a shiny new mc13783 API function that can be used instead.
>
> While at it refactor the code a bit to reduce code duplication a bit.
>
> This removes the last user of <linux/mfd/mc13783-private.h> and so this
> include file can go away.
That's correct, patch applied.
As I said, we can now move mc13783-private.h to drivers/mfd/
Cheers,
Samuel.
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/hwmon/mc13783-adc.c | 17 +++++++++++++----
> 1 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
> index ce3c7bc..d5226c9 100644
> --- a/drivers/hwmon/mc13783-adc.c
> +++ b/drivers/hwmon/mc13783-adc.c
> @@ -18,7 +18,7 @@
> * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> -#include <linux/mfd/mc13783-private.h>
> +#include <linux/mfd/mc13783.h>
> #include <linux/platform_device.h>
> #include <linux/hwmon-sysfs.h>
> #include <linux/kernel.h>
> @@ -144,6 +144,14 @@ static const struct attribute_group mc13783_group_ts = {
> .attrs = mc13783_attr_ts,
> };
>
> +static int mc13783_adc_use_touchscreen(struct platform_device *pdev)
> +{
> + struct mc13783_adc_priv *priv = platform_get_drvdata(pdev);
> + unsigned flags = mc13783_get_flags(priv->mc13783);
> +
> + return flags & MC13783_USE_TOUCHSCREEN;
> +}
> +
> static int __init mc13783_adc_probe(struct platform_device *pdev)
> {
> struct mc13783_adc_priv *priv;
> @@ -162,10 +170,11 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
> if (ret)
> goto out_err_create1;
>
> - if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
> + if (!mc13783_adc_use_touchscreen(pdev)) {
> ret = sysfs_create_group(&pdev->dev.kobj, &mc13783_group_ts);
> if (ret)
> goto out_err_create2;
> + }
>
> priv->hwmon_dev = hwmon_device_register(&pdev->dev);
> if (IS_ERR(priv->hwmon_dev)) {
> @@ -180,7 +189,7 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
>
> out_err_register:
>
> - if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
> + if (!mc13783_adc_use_touchscreen(pdev))
> sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
> out_err_create2:
>
> @@ -199,7 +208,7 @@ static int __devexit mc13783_adc_remove(struct platform_device *pdev)
>
> hwmon_device_unregister(priv->hwmon_dev);
>
> - if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN))
> + if (!mc13783_adc_use_touchscreen(pdev))
> sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
>
> sysfs_remove_group(&pdev->dev.kobj, &mc13783_group);
> --
> 1.7.1
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly
2010-08-02 10:04 ` Samuel Ortiz
@ 2010-08-02 12:52 ` Uwe Kleine-König
2010-08-02 13:48 ` [PATCH 3/2] mfd/mc13783: get rid of now unused private header Uwe Kleine-König
1 sibling, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2010-08-02 12:52 UTC (permalink / raw)
To: Samuel Ortiz
Cc: linux-kernel, lm-sensors, Hans de Goede, Mark Brown, Tejun Heo,
Jean Delvare
On Mon, Aug 02, 2010 at 12:04:56PM +0200, Samuel Ortiz wrote:
> Hi Uwe,
>
> On Mon, Aug 02, 2010 at 11:14:18AM +0200, Uwe Kleine-König wrote:
> > There is a shiny new mc13783 API function that can be used instead.
> >
> > While at it refactor the code a bit to reduce code duplication a bit.
> >
> > This removes the last user of <linux/mfd/mc13783-private.h> and so this
> > include file can go away.
> That's correct, patch applied.
> As I said, we can now move mc13783-private.h to drivers/mfd/
Actually I'd fold it into mc13783-core.c.
And I didn't do it at once because I didn't expect you to take the hwmon
change via your tree. Will send a patch later.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/2] mfd/mc13783: get rid of now unused private header
2010-08-02 10:04 ` Samuel Ortiz
2010-08-02 12:52 ` Uwe Kleine-König
@ 2010-08-02 13:48 ` Uwe Kleine-König
2010-08-03 10:10 ` Samuel Ortiz
1 sibling, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2010-08-02 13:48 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: linux-kernel, Sascha Hauer, Alberto Panizzo, Andrew Morton
This adds all remaining definitions that are used by the core driver
to the .c file.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/mfd/mc13783-core.c | 24 ++++-
include/linux/mfd/mc13783-private.h | 220 -----------------------------------
2 files changed, 23 insertions(+), 221 deletions(-)
delete mode 100644 include/linux/mfd/mc13783-private.h
diff --git a/drivers/mfd/mc13783-core.c b/drivers/mfd/mc13783-core.c
index a4fa191..6834edb 100644
--- a/drivers/mfd/mc13783-core.c
+++ b/drivers/mfd/mc13783-core.c
@@ -11,9 +11,31 @@
*/
#include <linux/slab.h>
#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mutex.h>
+#include <linux/interrupt.h>
#include <linux/spi/spi.h>
#include <linux/mfd/core.h>
-#include <linux/mfd/mc13783-private.h>
+#include <linux/mfd/mc13783.h>
+
+struct mc13783 {
+ struct spi_device *spidev;
+ struct mutex lock;
+ int irq;
+ int flags;
+
+ irq_handler_t irqhandler[MC13783_NUM_IRQ];
+ void *irqdata[MC13783_NUM_IRQ];
+
+ /* XXX these should go as platformdata to the regulator subdevice */
+ struct mc13783_regulator_init_data *regulators;
+ int num_regulators;
+};
+
+#define MC13783_REG_REVISION 7
+#define MC13783_REG_ADC_0 43
+#define MC13783_REG_ADC_1 44
+#define MC13783_REG_ADC_2 45
#define MC13783_IRQSTAT0 0
#define MC13783_IRQSTAT0_ADCDONEI (1 << 0)
diff --git a/include/linux/mfd/mc13783-private.h b/include/linux/mfd/mc13783-private.h
deleted file mode 100644
index 95cf936..0000000
--- a/include/linux/mfd/mc13783-private.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * Initial development of this code was funded by
- * Phytec Messtechnik GmbH, http://www.phytec.de
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __LINUX_MFD_MC13783_PRIV_H
-#define __LINUX_MFD_MC13783_PRIV_H
-
-#include <linux/platform_device.h>
-#include <linux/mfd/mc13783.h>
-#include <linux/mutex.h>
-#include <linux/interrupt.h>
-
-struct mc13783 {
- struct spi_device *spidev;
- struct mutex lock;
- int irq;
- int flags;
-
- irq_handler_t irqhandler[MC13783_NUM_IRQ];
- void *irqdata[MC13783_NUM_IRQ];
-
- /* XXX these should go as platformdata to the regulator subdevice */
- struct mc13783_regulator_init_data *regulators;
- int num_regulators;
-};
-
-#define MC13783_REG_INTERRUPT_STATUS_0 0
-#define MC13783_REG_INTERRUPT_MASK_0 1
-#define MC13783_REG_INTERRUPT_SENSE_0 2
-#define MC13783_REG_INTERRUPT_STATUS_1 3
-#define MC13783_REG_INTERRUPT_MASK_1 4
-#define MC13783_REG_INTERRUPT_SENSE_1 5
-#define MC13783_REG_POWER_UP_MODE_SENSE 6
-#define MC13783_REG_REVISION 7
-#define MC13783_REG_SEMAPHORE 8
-#define MC13783_REG_ARBITRATION_PERIPHERAL_AUDIO 9
-#define MC13783_REG_ARBITRATION_SWITCHERS 10
-#define MC13783_REG_ARBITRATION_REGULATORS_0 11
-#define MC13783_REG_ARBITRATION_REGULATORS_1 12
-#define MC13783_REG_POWER_CONTROL_0 13
-#define MC13783_REG_POWER_CONTROL_1 14
-#define MC13783_REG_POWER_CONTROL_2 15
-#define MC13783_REG_REGEN_ASSIGNMENT 16
-#define MC13783_REG_CONTROL_SPARE 17
-#define MC13783_REG_MEMORY_A 18
-#define MC13783_REG_MEMORY_B 19
-#define MC13783_REG_RTC_TIME 20
-#define MC13783_REG_RTC_ALARM 21
-#define MC13783_REG_RTC_DAY 22
-#define MC13783_REG_RTC_DAY_ALARM 23
-#define MC13783_REG_SWITCHERS_0 24
-#define MC13783_REG_SWITCHERS_1 25
-#define MC13783_REG_SWITCHERS_2 26
-#define MC13783_REG_SWITCHERS_3 27
-#define MC13783_REG_SWITCHERS_4 28
-#define MC13783_REG_SWITCHERS_5 29
-#define MC13783_REG_REGULATOR_SETTING_0 30
-#define MC13783_REG_REGULATOR_SETTING_1 31
-#define MC13783_REG_REGULATOR_MODE_0 32
-#define MC13783_REG_REGULATOR_MODE_1 33
-#define MC13783_REG_POWER_MISCELLANEOUS 34
-#define MC13783_REG_POWER_SPARE 35
-#define MC13783_REG_AUDIO_RX_0 36
-#define MC13783_REG_AUDIO_RX_1 37
-#define MC13783_REG_AUDIO_TX 38
-#define MC13783_REG_AUDIO_SSI_NETWORK 39
-#define MC13783_REG_AUDIO_CODEC 40
-#define MC13783_REG_AUDIO_STEREO_DAC 41
-#define MC13783_REG_AUDIO_SPARE 42
-#define MC13783_REG_ADC_0 43
-#define MC13783_REG_ADC_1 44
-#define MC13783_REG_ADC_2 45
-#define MC13783_REG_ADC_3 46
-#define MC13783_REG_ADC_4 47
-#define MC13783_REG_CHARGER 48
-#define MC13783_REG_USB 49
-#define MC13783_REG_CHARGE_USB_SPARE 50
-#define MC13783_REG_LED_CONTROL_0 51
-#define MC13783_REG_LED_CONTROL_1 52
-#define MC13783_REG_LED_CONTROL_2 53
-#define MC13783_REG_LED_CONTROL_3 54
-#define MC13783_REG_LED_CONTROL_4 55
-#define MC13783_REG_LED_CONTROL_5 56
-#define MC13783_REG_SPARE 57
-#define MC13783_REG_TRIM_0 58
-#define MC13783_REG_TRIM_1 59
-#define MC13783_REG_TEST_0 60
-#define MC13783_REG_TEST_1 61
-#define MC13783_REG_TEST_2 62
-#define MC13783_REG_TEST_3 63
-#define MC13783_REG_NB 64
-
-/*
- * Reg Regulator Mode 0
- */
-#define MC13783_REGCTRL_VAUDIO_EN (1 << 0)
-#define MC13783_REGCTRL_VAUDIO_STBY (1 << 1)
-#define MC13783_REGCTRL_VAUDIO_MODE (1 << 2)
-#define MC13783_REGCTRL_VIOHI_EN (1 << 3)
-#define MC13783_REGCTRL_VIOHI_STBY (1 << 4)
-#define MC13783_REGCTRL_VIOHI_MODE (1 << 5)
-#define MC13783_REGCTRL_VIOLO_EN (1 << 6)
-#define MC13783_REGCTRL_VIOLO_STBY (1 << 7)
-#define MC13783_REGCTRL_VIOLO_MODE (1 << 8)
-#define MC13783_REGCTRL_VDIG_EN (1 << 9)
-#define MC13783_REGCTRL_VDIG_STBY (1 << 10)
-#define MC13783_REGCTRL_VDIG_MODE (1 << 11)
-#define MC13783_REGCTRL_VGEN_EN (1 << 12)
-#define MC13783_REGCTRL_VGEN_STBY (1 << 13)
-#define MC13783_REGCTRL_VGEN_MODE (1 << 14)
-#define MC13783_REGCTRL_VRFDIG_EN (1 << 15)
-#define MC13783_REGCTRL_VRFDIG_STBY (1 << 16)
-#define MC13783_REGCTRL_VRFDIG_MODE (1 << 17)
-#define MC13783_REGCTRL_VRFREF_EN (1 << 18)
-#define MC13783_REGCTRL_VRFREF_STBY (1 << 19)
-#define MC13783_REGCTRL_VRFREF_MODE (1 << 20)
-#define MC13783_REGCTRL_VRFCP_EN (1 << 21)
-#define MC13783_REGCTRL_VRFCP_STBY (1 << 22)
-#define MC13783_REGCTRL_VRFCP_MODE (1 << 23)
-
-/*
- * Reg Regulator Mode 1
- */
-#define MC13783_REGCTRL_VSIM_EN (1 << 0)
-#define MC13783_REGCTRL_VSIM_STBY (1 << 1)
-#define MC13783_REGCTRL_VSIM_MODE (1 << 2)
-#define MC13783_REGCTRL_VESIM_EN (1 << 3)
-#define MC13783_REGCTRL_VESIM_STBY (1 << 4)
-#define MC13783_REGCTRL_VESIM_MODE (1 << 5)
-#define MC13783_REGCTRL_VCAM_EN (1 << 6)
-#define MC13783_REGCTRL_VCAM_STBY (1 << 7)
-#define MC13783_REGCTRL_VCAM_MODE (1 << 8)
-#define MC13783_REGCTRL_VRFBG_EN (1 << 9)
-#define MC13783_REGCTRL_VRFBG_STBY (1 << 10)
-#define MC13783_REGCTRL_VVIB_EN (1 << 11)
-#define MC13783_REGCTRL_VRF1_EN (1 << 12)
-#define MC13783_REGCTRL_VRF1_STBY (1 << 13)
-#define MC13783_REGCTRL_VRF1_MODE (1 << 14)
-#define MC13783_REGCTRL_VRF2_EN (1 << 15)
-#define MC13783_REGCTRL_VRF2_STBY (1 << 16)
-#define MC13783_REGCTRL_VRF2_MODE (1 << 17)
-#define MC13783_REGCTRL_VMMC1_EN (1 << 18)
-#define MC13783_REGCTRL_VMMC1_STBY (1 << 19)
-#define MC13783_REGCTRL_VMMC1_MODE (1 << 20)
-#define MC13783_REGCTRL_VMMC2_EN (1 << 21)
-#define MC13783_REGCTRL_VMMC2_STBY (1 << 22)
-#define MC13783_REGCTRL_VMMC2_MODE (1 << 23)
-
-/*
- * Reg Regulator Misc.
- */
-#define MC13783_REGCTRL_GPO1_EN (1 << 6)
-#define MC13783_REGCTRL_GPO2_EN (1 << 8)
-#define MC13783_REGCTRL_GPO3_EN (1 << 10)
-#define MC13783_REGCTRL_GPO4_EN (1 << 12)
-#define MC13783_REGCTRL_VIBPINCTRL (1 << 14)
-
-/*
- * Reg Switcher 4
- */
-#define MC13783_SWCTRL_SW1A_MODE (1 << 0)
-#define MC13783_SWCTRL_SW1A_STBY_MODE (1 << 2)
-#define MC13783_SWCTRL_SW1A_DVS_SPEED (1 << 6)
-#define MC13783_SWCTRL_SW1A_PANIC_MODE (1 << 8)
-#define MC13783_SWCTRL_SW1A_SOFTSTART (1 << 9)
-#define MC13783_SWCTRL_SW1B_MODE (1 << 10)
-#define MC13783_SWCTRL_SW1B_STBY_MODE (1 << 12)
-#define MC13783_SWCTRL_SW1B_DVS_SPEED (1 << 14)
-#define MC13783_SWCTRL_SW1B_PANIC_MODE (1 << 16)
-#define MC13783_SWCTRL_SW1B_SOFTSTART (1 << 17)
-#define MC13783_SWCTRL_PLL_EN (1 << 18)
-#define MC13783_SWCTRL_PLL_FACTOR (1 << 19)
-
-/*
- * Reg Switcher 5
- */
-#define MC13783_SWCTRL_SW2A_MODE (1 << 0)
-#define MC13783_SWCTRL_SW2A_STBY_MODE (1 << 2)
-#define MC13783_SWCTRL_SW2A_DVS_SPEED (1 << 6)
-#define MC13783_SWCTRL_SW2A_PANIC_MODE (1 << 8)
-#define MC13783_SWCTRL_SW2A_SOFTSTART (1 << 9)
-#define MC13783_SWCTRL_SW2B_MODE (1 << 10)
-#define MC13783_SWCTRL_SW2B_STBY_MODE (1 << 12)
-#define MC13783_SWCTRL_SW2B_DVS_SPEED (1 << 14)
-#define MC13783_SWCTRL_SW2B_PANIC_MODE (1 << 16)
-#define MC13783_SWCTRL_SW2B_SOFTSTART (1 << 17)
-#define MC13783_SWSET_SW3 (1 << 18)
-#define MC13783_SWCTRL_SW3_EN (1 << 20)
-#define MC13783_SWCTRL_SW3_STBY (1 << 21)
-#define MC13783_SWCTRL_SW3_MODE (1 << 22)
-
-static inline int mc13783_set_bits(struct mc13783 *mc13783, unsigned int offset,
- u32 mask, u32 val)
-{
- int ret;
- mc13783_lock(mc13783);
- ret = mc13783_reg_rmw(mc13783, offset, mask, val);
- mc13783_unlock(mc13783);
-
- return ret;
-}
-
-#endif /* __LINUX_MFD_MC13783_PRIV_H */
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 3/2] mfd/mc13783: get rid of now unused private header
2010-08-02 13:48 ` [PATCH 3/2] mfd/mc13783: get rid of now unused private header Uwe Kleine-König
@ 2010-08-03 10:10 ` Samuel Ortiz
0 siblings, 0 replies; 7+ messages in thread
From: Samuel Ortiz @ 2010-08-03 10:10 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-kernel, Sascha Hauer, Alberto Panizzo, Andrew Morton
Hi Uwe,
On Mon, Aug 02, 2010 at 03:48:04PM +0200, Uwe Kleine-König wrote:
> This adds all remaining definitions that are used by the core driver
> to the .c file.
Patch applied, many thanks.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] mfd/mc13783: new function exposing flags
2010-08-02 9:14 [PATCH 1/2] mfd/mc13783: new function exposing flags Uwe Kleine-König
2010-08-02 9:14 ` [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly Uwe Kleine-König
@ 2010-08-02 10:01 ` Samuel Ortiz
1 sibling, 0 replies; 7+ messages in thread
From: Samuel Ortiz @ 2010-08-02 10:01 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-kernel, lm-sensors, Andrew Morton, Alberto Panizzo,
Sascha Hauer
Hi Uwe,
On Mon, Aug 02, 2010 at 11:14:17AM +0200, Uwe Kleine-König wrote:
> This is needed for the mc13783-adc driver to decide if a touch screen is
> connected. If so some channels are not available as generic hwmon inputs.
Looks good to me, applied to my for-next branch.
Now that we're at it, could we then move mc13783-private.h from include/linux/
to driver/mfd ?
Cheers,
Samuel.
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/mfd/mc13783-core.c | 6 ++++++
> include/linux/mfd/mc13783.h | 2 ++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mfd/mc13783-core.c b/drivers/mfd/mc13783-core.c
> index ead84e4..a4fa191 100644
> --- a/drivers/mfd/mc13783-core.c
> +++ b/drivers/mfd/mc13783-core.c
> @@ -226,6 +226,12 @@ int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset,
> }
> EXPORT_SYMBOL(mc13783_reg_rmw);
>
> +int mc13783_get_flags(struct mc13783 *mc13783)
> +{
> + return mc13783->flags;
> +}
> +EXPORT_SYMBOL(mc13783_get_flags);
> +
> int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
> {
> int ret;
> diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
> index 4a894f6..0fa44fb 100644
> --- a/include/linux/mfd/mc13783.h
> +++ b/include/linux/mfd/mc13783.h
> @@ -21,6 +21,8 @@ int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val);
> int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset,
> u32 mask, u32 val);
>
> +int mc13783_get_flags(struct mc13783 *mc13783);
> +
> int mc13783_irq_request(struct mc13783 *mc13783, int irq,
> irq_handler_t handler, const char *name, void *dev);
> int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
> --
> 1.7.1
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-08-03 10:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02 9:14 [PATCH 1/2] mfd/mc13783: new function exposing flags Uwe Kleine-König
2010-08-02 9:14 ` [PATCH 2/2] hwmon/mc13783-adc: don't access struct mc13783 directly Uwe Kleine-König
2010-08-02 10:04 ` Samuel Ortiz
2010-08-02 12:52 ` Uwe Kleine-König
2010-08-02 13:48 ` [PATCH 3/2] mfd/mc13783: get rid of now unused private header Uwe Kleine-König
2010-08-03 10:10 ` Samuel Ortiz
2010-08-02 10:01 ` [PATCH 1/2] mfd/mc13783: new function exposing flags Samuel Ortiz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.