[PATCH] omap4: fix build error when undefining CONFIG_SMP

2011-06-13 Thread Vadillo, Miguel
From 0cffeab240c6009fbc81783cec16d35dc240196a Mon Sep 17 00:00:00 2001
From: Miguel Vadillo vadi...@ti.com
Date: Fri, 10 Jun 2011 16:06:20 -0500
Subject: [PATCH] omap4: fix build error when undefining CONFIG_SMP

Function omap_smc2 is undeclared when disabling SMP

Signed-off-by: Miguel Vadillo vadi...@ti.com
---
 arch/arm/mach-omap2/include/mach/omap4-common.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h
b/arch/arm/mach-omap2/include/mach/omap4-common.h
index f9769d3..1923b4e 100644
--- a/arch/arm/mach-omap2/include/mach/omap4-common.h
+++ b/arch/arm/mach-omap2/include/mach/omap4-common.h
@@ -74,7 +74,7 @@ extern int omap4_mpuss_init(void);
 extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);
 extern void omap4_cpu_suspend(unsigned int cpu, unsigned int save_state);
 extern void omap4_cpu_resume(void);
-extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
+extern u32 omap_smc2(u32 id, u32 flag, u32 pargs);
 extern u32 omap4_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
   u32 arg1, u32 arg2, u32 arg3, u32 arg4);
 #else
@@ -99,6 +99,10 @@ static inline void omap4_cpu_resume(void)
 {
 }

+static inline u32 omap_smc2(u32 id, u32 flag, u32 pargs)
+{
+   return 0;
+}
 #endif
 #endif /* __ASSEMBLER__ */
 #endif /* OMAP_ARCH_OMAP4_COMMON_H */
--
1.7.1
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap4: fix build error when undefining CONFIG_SMP

2011-06-13 Thread Santosh Shilimkar

On 6/13/2011 11:55 AM, Vadillo, Miguel wrote:

 From 0cffeab240c6009fbc81783cec16d35dc240196a Mon Sep 17 00:00:00 2001
From: Miguel Vadillovadi...@ti.com
Date: Fri, 10 Jun 2011 16:06:20 -0500
Subject: [PATCH] omap4: fix build error when undefining CONFIG_SMP

Function omap_smc2 is undeclared when disabling SMP

Signed-off-by: Miguel Vadillovadi...@ti.com
---
  arch/arm/mach-omap2/include/mach/omap4-common.h |6 +-
  1 files changed, 5 insertions(+), 1 deletions(-)


Acked-by: Santosh Shilimkar santosh.shilim...@ti.com


diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h
b/arch/arm/mach-omap2/include/mach/omap4-common.h
index f9769d3..1923b4e 100644
--- a/arch/arm/mach-omap2/include/mach/omap4-common.h
+++ b/arch/arm/mach-omap2/include/mach/omap4-common.h
@@ -74,7 +74,7 @@ extern int omap4_mpuss_init(void);
  extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);
  extern void omap4_cpu_suspend(unsigned int cpu, unsigned int save_state);
  extern void omap4_cpu_resume(void);
-extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
+extern u32 omap_smc2(u32 id, u32 flag, u32 pargs);
  extern u32 omap4_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
u32 arg1, u32 arg2, u32 arg3, u32 arg4);
  #else
@@ -99,6 +99,10 @@ static inline void omap4_cpu_resume(void)
  {
  }

+static inline u32 omap_smc2(u32 id, u32 flag, u32 pargs)
+{
+   return 0;
+}
  #endif
  #endif /* __ASSEMBLER__ */
  #endif /* OMAP_ARCH_OMAP4_COMMON_H */
--
1.7.1


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: N900 USB fix (Was: Re: [PATCH/RFC 2/6] OMAP2+: PM: move runtime PM implementation to use device power domains)

2011-06-13 Thread Jarkko Nikula
On Fri, 10 Jun 2011 09:57:57 +0300
Sakari Ailus sakari.ai...@maxwell.research.nokia.com wrote:

  A fix has been posted (and pull req sent to Tony.)  Can you try my
  for_3.0/pm-fixes branch which fixes this problem?  It's available in my
  git tree:
  
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
 
 Hi, Kevin!
 
 Many thanks to you! :-) The patches indeed fix the problem. I seem to
 have used for_3.0/pm-fixes-2 branch, though. I guess that doesn't really
 matter. :-)
 
I was struggling also with non-working musb on N900. I traced primary
breakage to the same commit than Sakari. On top of that commit the
Kevin's fix made it working but it didn't work on top of 3.0-rc2 while
beagle was ok.

I bisected another issue to commit 10299e2 (ARM: RX-51: Enable isp1704
power on/off).

3.0-rc2 works if I enable the CONFIG_CHARGER_ISP1704=y but do we
actually need to drive the ISP1704 into reset in
board-rx51-peripherals.c: rx51_charger_init as it breaks the musb when
the ISP1704 driver is missing and otherwise rx51_charger_set_power
should take care of ISP1704 reset control when the driver is there?

-- 
Jarkko
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: N900 USB fix (Was: Re: [PATCH/RFC 2/6] OMAP2+: PM: move runtime PM implementation to use device power domains)

2011-06-13 Thread Felipe Balbi
Hi,

On Mon, Jun 13, 2011 at 11:28:20AM +0300, Jarkko Nikula wrote:
 On Fri, 10 Jun 2011 09:57:57 +0300
 Sakari Ailus sakari.ai...@maxwell.research.nokia.com wrote:
 
   A fix has been posted (and pull req sent to Tony.)  Can you try my
   for_3.0/pm-fixes branch which fixes this problem?  It's available in my
   git tree:
   
 git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
  
  Hi, Kevin!
  
  Many thanks to you! :-) The patches indeed fix the problem. I seem to
  have used for_3.0/pm-fixes-2 branch, though. I guess that doesn't really
  matter. :-)
  
 I was struggling also with non-working musb on N900. I traced primary
 breakage to the same commit than Sakari. On top of that commit the
 Kevin's fix made it working but it didn't work on top of 3.0-rc2 while
 beagle was ok.
 
 I bisected another issue to commit 10299e2 (ARM: RX-51: Enable isp1704
 power on/off).
 
 3.0-rc2 works if I enable the CONFIG_CHARGER_ISP1704=y but do we
 actually need to drive the ISP1704 into reset in
 board-rx51-peripherals.c: rx51_charger_init as it breaks the musb when
 the ISP1704 driver is missing and otherwise rx51_charger_set_power
 should take care of ISP1704 reset control when the driver is there?

You might want to ask from Heikki. He patched that part of the code.

-- 
balbi


signature.asc
Description: Digital signature


Re: N900 USB fix (Was: Re: [PATCH/RFC 2/6] OMAP2+: PM: move runtime PM implementation to use device power domains)

2011-06-13 Thread Felipe Balbi
Hi,

On Mon, Jun 13, 2011 at 11:46:04AM +0300, Felipe Balbi wrote:
 On Mon, Jun 13, 2011 at 11:28:20AM +0300, Jarkko Nikula wrote:
  On Fri, 10 Jun 2011 09:57:57 +0300
  Sakari Ailus sakari.ai...@maxwell.research.nokia.com wrote:
  
A fix has been posted (and pull req sent to Tony.)  Can you try my
for_3.0/pm-fixes branch which fixes this problem?  It's available in my
git tree:

  
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
   
   Hi, Kevin!
   
   Many thanks to you! :-) The patches indeed fix the problem. I seem to
   have used for_3.0/pm-fixes-2 branch, though. I guess that doesn't really
   matter. :-)
   
  I was struggling also with non-working musb on N900. I traced primary
  breakage to the same commit than Sakari. On top of that commit the
  Kevin's fix made it working but it didn't work on top of 3.0-rc2 while
  beagle was ok.
  
  I bisected another issue to commit 10299e2 (ARM: RX-51: Enable isp1704
  power on/off).
  
  3.0-rc2 works if I enable the CONFIG_CHARGER_ISP1704=y but do we
  actually need to drive the ISP1704 into reset in
  board-rx51-peripherals.c: rx51_charger_init as it breaks the musb when
  the ISP1704 driver is missing and otherwise rx51_charger_set_power
  should take care of ISP1704 reset control when the driver is there?
 
 You might want to ask from Heikki. He patched that part of the code.

used wrong mail address for Heikki, fixing.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v4 11/18] input: Add initial support for TWL6040 vibrator

2011-06-13 Thread Dmitry Torokhov
Hi Peter,

On Fri, Jun 10, 2011 at 02:54:29PM +0300, Peter Ujfalusi wrote:
 From: Misael Lopez Cruz misael.lo...@ti.com
 
 Add twl6040_vibra as a child of MFD device twl6040_codec. This
 implementation covers the PCM-to-PWM mode of TWL6040 vibrator
 module.
 
 Signed-off-by: Jorge Eduardo Candelaria jorge.candela...@ti.com
 Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 ---
  drivers/input/misc/Kconfig |   11 +
  drivers/input/misc/Makefile|1 +
  drivers/input/misc/twl6040-vibra.c |  428 
 
  include/linux/i2c/twl.h|8 +
  4 files changed, 448 insertions(+), 0 deletions(-)
  create mode 100644 drivers/input/misc/twl6040-vibra.c
 
 diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
 index 077309a..d1bf872 100644
 --- a/drivers/input/misc/Kconfig
 +++ b/drivers/input/misc/Kconfig
 @@ -275,6 +275,17 @@ config INPUT_TWL4030_VIBRA
 To compile this driver as a module, choose M here. The module will
 be called twl4030_vibra.
  
 +config INPUT_TWL6040_VIBRA
 + tristate Support for TWL6040 Vibrator
 + depends on TWL4030_CORE
 + select TWL6040_CORE
 + select INPUT_FF_MEMLESS
 + help
 +   This option enables support for TWL6040 Vibrator Driver.
 +
 +   To compile this driver as a module, choose M here. The module will
 +   be called twl6040_vibra.
 +
  config INPUT_UINPUT
   tristate User level driver support
   help
 diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
 index 38efb2c..4da7c3a 100644
 --- a/drivers/input/misc/Makefile
 +++ b/drivers/input/misc/Makefile
 @@ -40,6 +40,7 @@ obj-$(CONFIG_INPUT_SGI_BTNS)+= sgi_btns.o
  obj-$(CONFIG_INPUT_SPARCSPKR)+= sparcspkr.o
  obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)+= twl4030-pwrbutton.o
  obj-$(CONFIG_INPUT_TWL4030_VIBRA)+= twl4030-vibra.o
 +obj-$(CONFIG_INPUT_TWL6040_VIBRA)+= twl6040-vibra.o
  obj-$(CONFIG_INPUT_UINPUT)   += uinput.o
  obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
  obj-$(CONFIG_INPUT_WM831X_ON)+= wm831x-on.o
 diff --git a/drivers/input/misc/twl6040-vibra.c 
 b/drivers/input/misc/twl6040-vibra.c
 new file mode 100644
 index 000..5a54515
 --- /dev/null
 +++ b/drivers/input/misc/twl6040-vibra.c
 @@ -0,0 +1,428 @@
 +/*
 + * twl6040-vibra.c - TWL6040 Vibrator driver
 + *
 + * Author:  Jorge Eduardo Candelaria jorge.candela...@ti.com
 + * Author:  Misael Lopez Cruz misael.lo...@ti.com
 + *
 + * Copyright:   (C) 2011 Texas Instruments, Inc.
 + *
 + * Based on twl4030-vibra.c by Henrik Saari henrik.sa...@nokia.com
 + *   Felipe Balbi felipe.ba...@nokia.com
 + *   Jari Vanhala ext-javi.vanh...@nokia.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + * 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., 51 Franklin St, Fifth Floor, Boston, MA
 + * 02110-1301 USA
 + *
 + */
 +#include linux/module.h
 +#include linux/platform_device.h
 +#include linux/workqueue.h
 +#include linux/i2c/twl.h
 +#include linux/mfd/twl6040.h
 +#include linux/slab.h
 +#include linux/delay.h
 +#include linux/regulator/consumer.h
 +
 +#define EFFECT_DIR_180_DEG   0x8000
 +
 +/* Recommended modulation index 85% */
 +#define TWL6040_VIBRA_MOD85
 +
 +#define TWL6040_NUM_SUPPLIES 2
 +
 +struct vibra_info {
 + struct device *dev;
 + struct input_dev *input_dev;
 + struct workqueue_struct *workqueue;
 + struct work_struct play_work;
 + struct mutex mutex;
 +
 + bool enabled;
 + int weak_speed;
 + int strong_speed;
 + int direction;
 +
 + unsigned int vibldrv_res;
 + unsigned int vibrdrv_res;
 + unsigned int viblmotor_res;
 + unsigned int vibrmotor_res;
 +
 + struct regulator_bulk_data supplies[TWL6040_NUM_SUPPLIES];
 +
 + struct twl6040 *twl6040;
 +};
 +
 +static irqreturn_t twl6040_vib_irq_handler(int irq, void *data)
 +{
 + struct vibra_info *info = data;
 + struct twl6040 *twl6040 = info-twl6040;
 + u8 status;
 +
 + status = twl6040_reg_read(twl6040, TWL6040_REG_STATUS);
 + if (status  TWL6040_VIBLOCDET) {
 + dev_warn(info-dev, Left Vibrator overcurrent detected\n);
 + twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL,
 +TWL6040_VIBENAL);
 + }
 + if (status  TWL6040_VIBROCDET) {

[PATCH 0/3] OMAPFB: Move auto-update to omapfb

2011-06-13 Thread Tomi Valkeinen
OMAP DSS driver has currently support to change the display's update mode from
manual to auto, but it's up to the display to implement support for this.
Normally displays only support one update mode.

As the the update mode support adds extra code to a place where it doesn't
really belong, this patch set removes update mode support from omapdss, and
implements a simple version of it in omapfb.

This will:
* Clean up omapdss
* Keep the omapfb's ioctl interface intact with functional update-mode ioctls
* Allow us to support auto-update for manual update displays for testing
* Allow us to do the above with the code in single place, for all manual-update
  displays, without any changes needed in display drivers

Auto-update for manual-update displays should be considered a hack, used only
for testing or temporarily running a userspace that doesn't properly support
manual-update displays. It should not be used in production systems.

The patches create a private workqueue for the update work to minimize impact
on other parts of the system. As this auto-update feature is not normally used,
the workqueue is only created when needed.

 Tomi

Tomi Valkeinen (3):
  OMAP: DSS2: OMAPFB: Add struct to store per-display data
  OMAP: DSS2: OMAPFB: Implement auto-update mode
  OMAP: DSS2: remove update_mode from omapdss

 drivers/video/omap2/displays/panel-taal.c |   17 ---
 drivers/video/omap2/dss/display.c |   45 
 drivers/video/omap2/dss/manager.c |   59 +++
 drivers/video/omap2/dss/venc.c|   17 ---
 drivers/video/omap2/omapfb/omapfb-ioctl.c |   72 +++---
 drivers/video/omap2/omapfb/omapfb-main.c  |  159 +++--
 drivers/video/omap2/omapfb/omapfb-sysfs.c |   34 ++
 drivers/video/omap2/omapfb/omapfb.h   |   37 ++-
 include/video/omapdss.h   |   11 --
 9 files changed, 241 insertions(+), 210 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] OMAP: DSS2: OMAPFB: Add struct to store per-display data

2011-06-13 Thread Tomi Valkeinen
Create a new struct omapfb_display_data to contain omapfb's private
per-display data. Move the bpp override there.

This struct will be used to hold auto/manual update state of a display
in the following patches.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/omapfb/omapfb-main.c |   29 +++--
 drivers/video/omap2/omapfb/omapfb.h  |   26 +++---
 2 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c 
b/drivers/video/omap2/omapfb/omapfb-main.c
index 505bc12..44eb666 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1858,10 +1858,11 @@ static void omapfb_free_resources(struct omapfb2_device 
*fbdev)
}
 
for (i = 0; i  fbdev-num_displays; i++) {
-   if (fbdev-displays[i]-state != OMAP_DSS_DISPLAY_DISABLED)
-   fbdev-displays[i]-driver-disable(fbdev-displays[i]);
+   struct omap_dss_device *dssdev = fbdev-displays[i].dssdev;
+   if (dssdev-state != OMAP_DSS_DISPLAY_DISABLED)
+   dssdev-driver-disable(dssdev);
 
-   omap_dss_put_device(fbdev-displays[i]);
+   omap_dss_put_device(dssdev);
}
 
dev_set_drvdata(fbdev-dev, NULL);
@@ -2084,14 +2085,14 @@ static int omapfb_set_def_mode(struct omapfb2_device 
*fbdev,
int r;
u8 bpp;
struct omap_video_timings timings, temp_timings;
+   struct omapfb_display_data *d;
 
r = omapfb_mode_to_timings(mode_str, timings, bpp);
if (r)
return r;
 
-   fbdev-bpp_overrides[fbdev-num_bpp_overrides].dssdev = display;
-   fbdev-bpp_overrides[fbdev-num_bpp_overrides].bpp = bpp;
-   ++fbdev-num_bpp_overrides;
+   d = get_display_data(fbdev, display);
+   d-bpp_override = bpp;
 
if (display-driver-check_timings) {
r = display-driver-check_timings(display, timings);
@@ -2117,14 +2118,14 @@ static int omapfb_set_def_mode(struct omapfb2_device 
*fbdev,
 static int omapfb_get_recommended_bpp(struct omapfb2_device *fbdev,
struct omap_dss_device *dssdev)
 {
-   int i;
+   struct omapfb_display_data *d;
 
BUG_ON(dssdev-driver-get_recommended_bpp == NULL);
 
-   for (i = 0; i  fbdev-num_bpp_overrides; ++i) {
-   if (dssdev == fbdev-bpp_overrides[i].dssdev)
-   return fbdev-bpp_overrides[i].bpp;
-   }
+   d = get_display_data(fbdev, dssdev);
+
+   if (d-bpp_override != 0)
+   return d-bpp_override;
 
return dssdev-driver-get_recommended_bpp(dssdev);
 }
@@ -2156,9 +2157,9 @@ static int omapfb_parse_def_modes(struct omapfb2_device 
*fbdev)
 
display = NULL;
for (i = 0; i  fbdev-num_displays; ++i) {
-   if (strcmp(fbdev-displays[i]-name,
+   if (strcmp(fbdev-displays[i].dssdev-name,
display_str) == 0) {
-   display = fbdev-displays[i];
+   display = fbdev-displays[i].dssdev;
break;
}
}
@@ -2282,7 +2283,7 @@ static int omapfb_probe(struct platform_device *pdev)
r = -ENODEV;
}
 
-   fbdev-displays[fbdev-num_displays++] = dssdev;
+   fbdev-displays[fbdev-num_displays++].dssdev = dssdev;
}
 
if (r)
diff --git a/drivers/video/omap2/omapfb/omapfb.h 
b/drivers/video/omap2/omapfb/omapfb.h
index aa1b1d9..f07dbbb 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -73,6 +73,11 @@ struct omapfb_info {
bool mirror;
 };
 
+struct omapfb_display_data {
+   struct omap_dss_device *dssdev;
+   u8 bpp_override;
+};
+
 struct omapfb2_device {
struct device *dev;
struct mutex  mtx;
@@ -86,17 +91,11 @@ struct omapfb2_device {
struct omapfb2_mem_region regions[10];
 
unsigned num_displays;
-   struct omap_dss_device *displays[10];
+   struct omapfb_display_data displays[10];
unsigned num_overlays;
struct omap_overlay *overlays[10];
unsigned num_managers;
struct omap_overlay_manager *managers[10];
-
-   unsigned num_bpp_overrides;
-   struct {
-   struct omap_dss_device *dssdev;
-   u8 bpp;
-   } bpp_overrides[10];
 };
 
 struct omapfb_colormode {
@@ -143,6 +142,19 @@ static inline struct omap_dss_device *fb2display(struct 
fb_info *fbi)
return NULL;
 }
 
+static inline struct omapfb_display_data *get_display_data(
+   struct omapfb2_device *fbdev, struct omap_dss_device *dssdev)
+{
+   int i;
+
+   for (i = 0; i  fbdev-num_displays; ++i)
+   if (fbdev-displays[i].dssdev == dssdev)
+ 

[PATCH 2/3] OMAP: DSS2: OMAPFB: Implement auto-update mode

2011-06-13 Thread Tomi Valkeinen
Implement auto-update mode for manual-update displays. omapfb driver
uses a delayed work to update the display with a constant rate.

The update mode can be changed via OMAPFB_SET_UPDATE_MODE ioctl, which
previously called omapdss but is now handled inside omapfb, and a new
sysfs file, update_mode.

The update interval is by default 20 times per second, but can be
changed via auto_update_freq module parameter. There is also a new
module parameter auto_update, which will make omapfb start manual
update displays in auto-update mode.

This auto-update mode can be used for testing if the userspace does not
support manual update displays properly. However, it is a very
inefficient solution, and should be considered more as a hack for
testing than something that could be used as a long term solution.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/omapfb/omapfb-ioctl.c |   72 
 drivers/video/omap2/omapfb/omapfb-main.c  |  130 
 drivers/video/omap2/omapfb/omapfb-sysfs.c |   34 
 drivers/video/omap2/omapfb/omapfb.h   |   13 +++
 4 files changed, 194 insertions(+), 55 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c 
b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index cff4503..6b1ac23 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -316,67 +316,67 @@ int omapfb_update_window(struct fb_info *fbi,
 }
 EXPORT_SYMBOL(omapfb_update_window);
 
-static int omapfb_set_update_mode(struct fb_info *fbi,
+int omapfb_set_update_mode(struct fb_info *fbi,
   enum omapfb_update_mode mode)
 {
struct omap_dss_device *display = fb2display(fbi);
-   enum omap_dss_update_mode um;
+   struct omapfb_info *ofbi = FB2OFB(fbi);
+   struct omapfb2_device *fbdev = ofbi-fbdev;
+   struct omapfb_display_data *d;
int r;
 
-   if (!display || !display-driver-set_update_mode)
+   if (!display)
return -EINVAL;
 
-   switch (mode) {
-   case OMAPFB_UPDATE_DISABLED:
-   um = OMAP_DSS_UPDATE_DISABLED;
-   break;
+   if (mode != OMAPFB_AUTO_UPDATE  mode != OMAPFB_MANUAL_UPDATE)
+   return -EINVAL;
 
-   case OMAPFB_AUTO_UPDATE:
-   um = OMAP_DSS_UPDATE_AUTO;
-   break;
+   omapfb_lock(fbdev);
 
-   case OMAPFB_MANUAL_UPDATE:
-   um = OMAP_DSS_UPDATE_MANUAL;
-   break;
+   d = get_display_data(fbdev, display);
 
-   default:
-   return -EINVAL;
+   if (d-update_mode == mode) {
+   omapfb_unlock(fbdev);
+   return 0;
}
 
-   r = display-driver-set_update_mode(display, um);
+   r = 0;
+
+   if (display-caps  OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
+   if (mode == OMAPFB_AUTO_UPDATE)
+   omapfb_start_auto_update(fbdev, display);
+   else /* MANUAL_UPDATE */
+   omapfb_stop_auto_update(fbdev, display);
+
+   d-update_mode = mode;
+   } else { /* AUTO_UPDATE */
+   if (mode == OMAPFB_MANUAL_UPDATE)
+   r = -EINVAL;
+   }
+
+   omapfb_unlock(fbdev);
 
return r;
 }
 
-static int omapfb_get_update_mode(struct fb_info *fbi,
+int omapfb_get_update_mode(struct fb_info *fbi,
enum omapfb_update_mode *mode)
 {
struct omap_dss_device *display = fb2display(fbi);
-   enum omap_dss_update_mode m;
+   struct omapfb_info *ofbi = FB2OFB(fbi);
+   struct omapfb2_device *fbdev = ofbi-fbdev;
+   struct omapfb_display_data *d;
 
if (!display)
return -EINVAL;
 
-   if (!display-driver-get_update_mode) {
-   *mode = OMAPFB_AUTO_UPDATE;
-   return 0;
-   }
+   omapfb_lock(fbdev);
 
-   m = display-driver-get_update_mode(display);
+   d = get_display_data(fbdev, display);
 
-   switch (m) {
-   case OMAP_DSS_UPDATE_DISABLED:
-   *mode = OMAPFB_UPDATE_DISABLED;
-   break;
-   case OMAP_DSS_UPDATE_AUTO:
-   *mode = OMAPFB_AUTO_UPDATE;
-   break;
-   case OMAP_DSS_UPDATE_MANUAL:
-   *mode = OMAPFB_MANUAL_UPDATE;
-   break;
-   default:
-   BUG();
-   }
+   *mode = d-update_mode;
+
+   omapfb_unlock(fbdev);
 
return 0;
 }
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c 
b/drivers/video/omap2/omapfb/omapfb-main.c
index 44eb666..c2514a2 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -46,6 +46,10 @@ static char *def_vram;
 static int def_vrfb;
 static int def_rotate;
 static int def_mirror;
+static bool auto_update;
+static unsigned int auto_update_freq;
+module_param(auto_update, bool, 0);
+module_param(auto_update_freq, uint, 0644);
 
 #ifdef DEBUG
 

[PATCH 3/3] OMAP: DSS2: remove update_mode from omapdss

2011-06-13 Thread Tomi Valkeinen
Remove the whole update_mode stuff from omapdss driver. If automatic
update for manual update displays is needed, it's better implemented in
higher layers.

Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
---
 drivers/video/omap2/displays/panel-taal.c |   17 
 drivers/video/omap2/dss/display.c |   45 --
 drivers/video/omap2/dss/manager.c |   59 +++--
 drivers/video/omap2/dss/venc.c|   17 
 include/video/omapdss.h   |   11 -
 5 files changed, 14 insertions(+), 135 deletions(-)

diff --git a/drivers/video/omap2/displays/panel-taal.c 
b/drivers/video/omap2/displays/panel-taal.c
index fdd5d4ae..221579f 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -1897,20 +1897,6 @@ err:
mutex_unlock(td-lock);
 }
 
-static int taal_set_update_mode(struct omap_dss_device *dssdev,
-   enum omap_dss_update_mode mode)
-{
-   if (mode != OMAP_DSS_UPDATE_MANUAL)
-   return -EINVAL;
-   return 0;
-}
-
-static enum omap_dss_update_mode taal_get_update_mode(
-   struct omap_dss_device *dssdev)
-{
-   return OMAP_DSS_UPDATE_MANUAL;
-}
-
 static struct omap_dss_driver taal_driver = {
.probe  = taal_probe,
.remove = __exit_p(taal_remove),
@@ -1920,9 +1906,6 @@ static struct omap_dss_driver taal_driver = {
.suspend= taal_suspend,
.resume = taal_resume,
 
-   .set_update_mode = taal_set_update_mode,
-   .get_update_mode = taal_get_update_mode,
-
.update = taal_update,
.sync   = taal_sync,
 
diff --git a/drivers/video/omap2/dss/display.c 
b/drivers/video/omap2/dss/display.c
index c2dfc8c..a0bbdf6 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -65,48 +65,6 @@ static ssize_t display_enabled_store(struct device *dev,
return size;
 }
 
-static ssize_t display_upd_mode_show(struct device *dev,
-   struct device_attribute *attr, char *buf)
-{
-   struct omap_dss_device *dssdev = to_dss_device(dev);
-   enum omap_dss_update_mode mode = OMAP_DSS_UPDATE_AUTO;
-   if (dssdev-driver-get_update_mode)
-   mode = dssdev-driver-get_update_mode(dssdev);
-   return snprintf(buf, PAGE_SIZE, %d\n, mode);
-}
-
-static ssize_t display_upd_mode_store(struct device *dev,
-   struct device_attribute *attr,
-   const char *buf, size_t size)
-{
-   struct omap_dss_device *dssdev = to_dss_device(dev);
-   int val, r;
-   enum omap_dss_update_mode mode;
-
-   if (!dssdev-driver-set_update_mode)
-   return -EINVAL;
-
-   r = kstrtoint(buf, 0, val);
-   if (r)
-   return r;
-
-   switch (val) {
-   case OMAP_DSS_UPDATE_DISABLED:
-   case OMAP_DSS_UPDATE_AUTO:
-   case OMAP_DSS_UPDATE_MANUAL:
-   mode = (enum omap_dss_update_mode)val;
-   break;
-   default:
-   return -EINVAL;
-   }
-
-   r = dssdev-driver-set_update_mode(dssdev, mode);
-   if (r)
-   return r;
-
-   return size;
-}
-
 static ssize_t display_tear_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
@@ -294,8 +252,6 @@ static ssize_t display_wss_store(struct device *dev,
 
 static DEVICE_ATTR(enabled, S_IRUGO|S_IWUSR,
display_enabled_show, display_enabled_store);
-static DEVICE_ATTR(update_mode, S_IRUGO|S_IWUSR,
-   display_upd_mode_show, display_upd_mode_store);
 static DEVICE_ATTR(tear_elim, S_IRUGO|S_IWUSR,
display_tear_show, display_tear_store);
 static DEVICE_ATTR(timings, S_IRUGO|S_IWUSR,
@@ -309,7 +265,6 @@ static DEVICE_ATTR(wss, S_IRUGO|S_IWUSR,
 
 static struct device_attribute *display_sysfs_attrs[] = {
dev_attr_enabled,
-   dev_attr_update_mode,
dev_attr_tear_elim,
dev_attr_timings,
dev_attr_rotate,
diff --git a/drivers/video/omap2/dss/manager.c 
b/drivers/video/omap2/dss/manager.c
index 9aeea50..18a1b92 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -416,8 +416,6 @@ struct overlay_cache_data {
enum omap_burst_size burst_size;
u32 fifo_low;
u32 fifo_high;
-
-   bool manual_update;
 };
 
 struct manager_cache_data {
@@ -437,7 +435,6 @@ struct manager_cache_data {
 
bool alpha_enabled;
 
-   bool manual_upd_display;
bool manual_update;
bool do_manual_update;
 
@@ -539,24 +536,15 @@ static int dss_mgr_wait_for_go(struct 
omap_overlay_manager *mgr)
if (!dssdev || dssdev-state != OMAP_DSS_DISPLAY_ACTIVE)
return 0;
 
+   if (dssdev-caps  OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE)
+   return 0;
+
if (dssdev-type == OMAP_DISPLAY_TYPE_VENC
|| dssdev-type == 

Re: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Felipe Balbi
Hi,


On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
 Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org

I need a sensible commit log for this. Why do we need to change all
min() to min_t() ?

-- 
balbi


signature.asc
Description: Digital signature


Re: Re: [PATCH v4 11/18] input: Add initial support for TWL6040 vibrator

2011-06-13 Thread Péter Ujfalusi
On Sunday 12 June 2011 01:18:54 Dmitry Torokhov wrote:
  +static void twl6040_vibra_enable(struct vibra_info *info)
  +{
  + struct twl6040 *twl6040 = info-twl6040;
  + int ret = 0;
 
 Initialization is not needed.

True.

  +static void vibra_play_work(struct work_struct *work)
  +{
  + struct vibra_info *info = container_of(work,
  + struct vibra_info, play_work);
  +
  + mutex_lock(info-mutex);
  +
  + if (info-weak_speed || info-strong_speed) {
  + if (!info-enabled)
  + twl6040_vibra_enable(info);
  +
  + twl6040_vibra_set_effect(info);
  + } else if (info-enabled)
  + twl6040_vibra_disable(info);
 
 Why do we play with enabling/disabling the device here? Nobody can
 request playing of an effect unless the device has been opened so if we
 manage power state in open/close methods we should not be doing it here
 I think.

We want to preserve as much power as we can.
So if application opens the driver, but it is not requesting to play any 
effect we still keep the device turned off.
When application request for stopping the effect without closing the device, 
we turn off things in a similar way.
The twl4030-vibra driver has been implemented in this way as well.

  +
  + mutex_unlock(info-mutex);
  +}

...

  +static int twl6040_vibra_open(struct input_dev *input)
  +{
  + struct vibra_info *info = input_get_drvdata(input);
  +
  + info-workqueue = create_singlethread_workqueue(vibra);
  + if (info-workqueue == NULL) {
  + dev_err(input-dev, couldn't create workqueue\n);
  + return -ENOMEM;
  + }
 
 Why do we need to create a separate workqueue? With arrival of CWQ
 it looks like we should be able to use one of the system-wide
 workqueues for this.

The reason for this is to ensure that we have the lowest latency as possible 
in most case. In the embedded devices we use the vibra for tactile type of 
feedbacks as well, where few tens of ms delay can be felt.

  +
  + return 0;
  +}
  +
  +static void twl6040_vibra_close(struct input_dev *input)
  +{
  + struct vibra_info *info = input_get_drvdata(input);
  +
  + cancel_work_sync(info-play_work);
  + INIT_WORK(info-play_work, vibra_play_work);
  + destroy_workqueue(info-workqueue);
  + info-workqueue = NULL;
  +
  + mutex_lock(info-mutex);
  +
  + if (info-enabled)
  + twl6040_vibra_disable(info);
  +
  + mutex_unlock(info-mutex);
  +}
  +
  +#if CONFIG_PM
 
 CONFIG_PM_SLEEP.

OK, will be fixed.

  +static int twl6040_vibra_suspend(struct device *dev)
  +{
  + struct platform_device *pdev = to_platform_device(dev);
  + struct vibra_info *info = platform_get_drvdata(pdev);
  +
  + mutex_lock(info-mutex);
  +
  + if (info-enabled)
  + twl6040_vibra_disable(info);
  +
  + mutex_unlock(info-mutex);
  +
  + return 0;
  +}
  +
  +static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops,
  +  twl6040_vibra_suspend, NULL);
 
 Move twl6040_vibra_pm_ops definition out of the #ifdef block so you
 won't need to protect it use with ifdefs later.

Thanks, I have change this.
 
  +#endif

...

  +static int __devexit twl6040_vibra_remove(struct platform_device *pdev)
  +{
  + struct vibra_info *info = platform_get_drvdata(pdev);
  +
  + twl6040_power(info-twl6040, 0);
 
 If we ensure that device is powered off until open() is called, and
 also powered off when close() is called, then we do not need to switch
 off power here.

True, removed.

 Thanks.
 
 --
 Dmitry

Thanks for the comments. I will update the series.

-- 
Péter
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value to int

2011-06-13 Thread Tomi Valkeinen
Paul, can you take this patch and queue it for an rc?

 Tomi

On Thu, 2011-06-09 at 16:56 +0300, Tomi Valkeinen wrote:
 get_context_loss_count functions return context loss count as u32, and
 zero means an error. However, zero is also returned when context has
 never been lost and could also be returned when the context loss count
 has wrapped and goes to zero.
 
 Change the functions to return an int, with negative value meaning an
 error.
 
 OMAP HSMMC code uses omap_pm_get_dev_context_loss_count(), but as the
 hsmmc code handles the returned value as an int, with negative value
 meaning an error, this patch actually fixes hsmmc code also.
 
 Signed-off-by: Tomi Valkeinen tomi.valkei...@ti.com
 Acked-by: Kevin Hilman khil...@ti.com
 ---
  arch/arm/mach-omap2/omap_hwmod.c  |2 +-
  arch/arm/mach-omap2/powerdomain.c |   14 ++
  arch/arm/mach-omap2/powerdomain.h |2 +-
  arch/arm/plat-omap/include/plat/omap-pm.h |4 ++--
  arch/arm/plat-omap/include/plat/omap_device.h |2 +-
  arch/arm/plat-omap/include/plat/omap_hwmod.h  |2 +-
  arch/arm/plat-omap/omap-pm-noop.c |   24 +---
  arch/arm/plat-omap/omap_device.c  |2 +-
  8 files changed, 34 insertions(+), 18 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
 b/arch/arm/mach-omap2/omap_hwmod.c
 index e034294..4f0d554 100644
 --- a/arch/arm/mach-omap2/omap_hwmod.c
 +++ b/arch/arm/mach-omap2/omap_hwmod.c
 @@ -2332,7 +2332,7 @@ ohsps_unlock:
   * Returns the context loss count of the powerdomain assocated with @oh
   * upon success, or zero if no powerdomain exists for @oh.
   */
 -u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
 +int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
  {
   struct powerdomain *pwrdm;
   int ret = 0;
 diff --git a/arch/arm/mach-omap2/powerdomain.c 
 b/arch/arm/mach-omap2/powerdomain.c
 index 9af0847..9d53a34 100644
 --- a/arch/arm/mach-omap2/powerdomain.c
 +++ b/arch/arm/mach-omap2/powerdomain.c
 @@ -935,16 +935,16 @@ int pwrdm_post_transition(void)
   * @pwrdm: struct powerdomain * to wait for
   *
   * Context loss count is the sum of powerdomain off-mode counter, the
 - * logic off counter and the per-bank memory off counter.  Returns 0
 + * logic off counter and the per-bank memory off counter.  Returns negative
   * (and WARNs) upon error, otherwise, returns the context loss count.
   */
 -u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
 +int pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
  {
   int i, count;
  
   if (!pwrdm) {
   WARN(1, powerdomain: %s: pwrdm is null\n, __func__);
 - return 0;
 + return -ENODEV;
   }
  
   count = pwrdm-state_counter[PWRDM_POWER_OFF];
 @@ -953,7 +953,13 @@ u32 pwrdm_get_context_loss_count(struct powerdomain 
 *pwrdm)
   for (i = 0; i  pwrdm-banks; i++)
   count += pwrdm-ret_mem_off_counter[i];
  
 - pr_debug(powerdomain: %s: context loss count = %u\n,
 + /*
 +  * Context loss count has to be a non-negative value. Clear the sign
 +  * bit to get a value range from 0 to INT_MAX.
 +  */
 + count = INT_MAX;
 +
 + pr_debug(powerdomain: %s: context loss count = %d\n,
pwrdm-name, count);
  
   return count;
 diff --git a/arch/arm/mach-omap2/powerdomain.h 
 b/arch/arm/mach-omap2/powerdomain.h
 index d23d979..012827f 100644
 --- a/arch/arm/mach-omap2/powerdomain.h
 +++ b/arch/arm/mach-omap2/powerdomain.h
 @@ -207,7 +207,7 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm);
  int pwrdm_pre_transition(void);
  int pwrdm_post_transition(void);
  int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
 -u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
 +int pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
  bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
  
  extern void omap2xxx_powerdomains_init(void);
 diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h 
 b/arch/arm/plat-omap/include/plat/omap-pm.h
 index c0a7520..68df031 100644
 --- a/arch/arm/plat-omap/include/plat/omap-pm.h
 +++ b/arch/arm/plat-omap/include/plat/omap-pm.h
 @@ -350,9 +350,9 @@ unsigned long omap_pm_cpu_get_freq(void);
   * driver must restore device context.   If the number of context losses
   * exceeds the maximum positive integer, the function will wrap to 0 and
   * continue counting.  Returns the number of context losses for this device,
 - * or zero upon error.
 + * or negative value upon error.
   */
 -u32 omap_pm_get_dev_context_loss_count(struct device *dev);
 +int omap_pm_get_dev_context_loss_count(struct device *dev);
  
  void omap_pm_enable_off_mode(void);
  void omap_pm_disable_off_mode(void);
 diff --git a/arch/arm/plat-omap/include/plat/omap_device.h 
 b/arch/arm/plat-omap/include/plat/omap_device.h
 index e4c349f..70d31d0 100644
 --- a/arch/arm/plat-omap/include/plat/omap_device.h
 

Re: [PATCH 1/9] OMAP: DSS2: Change DSI platform device name from omapdss_dsi1 to omapdss_dsi

2011-06-13 Thread Tomi Valkeinen
Tony, Ping.

I'd like this DSS regulator issue decided on way or another, as it's
stopping us getting Blaze board's panels working on mainline, and also
preventing me from porting the old omapfb drivers to DSS2.

 Tomi

On Tue, 2011-06-07 at 16:11 +0300, Tomi Valkeinen wrote:
 Hi Tony,
 
 On Wed, 2011-05-04 at 12:40 +0300, Tony Lindgren wrote:
  * Archit Taneja arc...@ti.com [110504 10:30]:
   --- a/arch/arm/mach-omap2/board-3430sdp.c
   +++ b/arch/arm/mach-omap2/board-3430sdp.c
   @@ -401,7 +401,7 @@ static struct regulator_consumer_supply 
   sdp3430_vdda_dac_supplies[] = {
/* VPLL2 for digital video outputs */
static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
 REGULATOR_SUPPLY(vdds_dsi, omapdss),
   - REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
   + REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
};

static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
   diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
   b/arch/arm/mach-omap2/board-4430sdp.c
   index 570e83f..eafadb4 100644
   --- a/arch/arm/mach-omap2/board-4430sdp.c
   +++ b/arch/arm/mach-omap2/board-4430sdp.c
   @@ -375,7 +375,7 @@ static struct regulator_consumer_supply 
   sdp4430_vmmc_supply[] = {
};
static struct regulator_consumer_supply sdp4430_vcxio_supply[] = {
 REGULATOR_SUPPLY(vdds_dsi, omapdss_dss),
   - REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
   + REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
};
  ...
  
  Looks like we should first combine all this cut and paste data
  for each board file into some common init function to cut
  down the crazy churn.
 
 I haven't been able to do this in a clean way. The regulator framework
 is rather static in this area, and adding the data for REGULATOR_SUPPLYs
 dynamically based on OMAP version is something I haven't been able to
 do.
 
 The best option I've found out is defining helper macros to add those
 consumers. An example patch below with 3430sdp and 4430sdp boards
 modified.
 
 This would allow boards to setup the regulators whatever way they want,
 but the 99% of the boards could just use the macros.
 
 It's still not as good as I'd want, because the source regulator is also
 the same for a particular OMAP version for 99% of the boards. So there's
 no real need to use those those macros in the board file, a common
 display file should be able to set everything up. But as I said, I
 haven't found out any way to do this.
 
 What is your opinion of this approach?
 
  Tomi
 
 
 
 diff --git a/arch/arm/mach-omap2/board-3430sdp.c
 b/arch/arm/mach-omap2/board-3430sdp.c
 index ae2963a..69b7e6f 100644
 --- a/arch/arm/mach-omap2/board-3430sdp.c
 +++ b/arch/arm/mach-omap2/board-3430sdp.c
 @@ -308,13 +308,12 @@ static struct regulator_consumer_supply
 sdp3430_vaux3_supplies[] = {
  };
  
  static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
 - REGULATOR_SUPPLY(vdda_dac, omapdss_venc),
 + OMAP_DSS_VENC_SUPPLIES,
  };
  
  /* VPLL2 for digital video outputs */
  static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
 - REGULATOR_SUPPLY(vdds_dsi, omapdss),
 - REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
 + OMAP_DSS_SUPPLIES,
  };
  
  static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
 diff --git a/arch/arm/mach-omap2/board-4430sdp.c
 b/arch/arm/mach-omap2/board-4430sdp.c
 index 2647a95..80bbf61 100644
 --- a/arch/arm/mach-omap2/board-4430sdp.c
 +++ b/arch/arm/mach-omap2/board-4430sdp.c
 @@ -339,8 +339,7 @@ static struct regulator_consumer_supply
 sdp4430_vmmc_supply[] = {
   },
  };
  static struct regulator_consumer_supply sdp4430_vcxio_supply[] = {
 - REGULATOR_SUPPLY(vdds_dsi, omapdss_dss),
 - REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
 + OMAP_DSS_SUPPLIES,
  };
  
  static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 diff --git a/include/video/omapdss.h b/include/video/omapdss.h
 index bb39738..557b400 100644
 --- a/include/video/omapdss.h
 +++ b/include/video/omapdss.h
 @@ -636,4 +636,12 @@ int omap_rfbi_update(struct omap_dss_device
 *dssdev,
  int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size,
   int data_lines);
  
 +#define OMAP_DSS_SUPPLIES \
 + REGULATOR_SUPPLY(vdds_sdi, omapdss_dss), \
 + REGULATOR_SUPPLY(vdds_dsi, omapdss_dss), \
 + REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1)
 +
 +#define OMAP_DSS_VENC_SUPPLIES \
 + REGULATOR_SUPPLY(vdda_dac, omapdss_venc)
 +
  #endif
 
 


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Tanya Brokhman
 
 On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
  Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org
 
 I need a sensible commit log for this. Why do we need to change all
 min() to min_t() ?
 

Actually, Alan asked me to make this change in one place in dummy_hcd. I
wasn't aware of the min_t macro before that. So when I searched the code for
other places I found quite a few and just thought that it would be nicer
to use min_t() instead of min() with casting. 
So we don't need to make this change. Everything works as is. This patch
only makes the code look nicer, nothing more.
I can elaborate the above in the commit log if you want.


Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.




--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Felipe Balbi
Hi,

On Mon, Jun 13, 2011 at 02:52:34PM +0300, Tanya Brokhman wrote:
  On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
   Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org
  
  I need a sensible commit log for this. Why do we need to change all
  min() to min_t() ?
  
 
 Actually, Alan asked me to make this change in one place in dummy_hcd. I
 wasn't aware of the min_t macro before that. So when I searched the code for
 other places I found quite a few and just thought that it would be nicer
 to use min_t() instead of min() with casting. 
 So we don't need to make this change. Everything works as is. This patch
 only makes the code look nicer, nothing more.
 I can elaborate the above in the commit log if you want.

Yes, that's what I need. The question was supposed to be answered by the
commit log ;-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH/RFC 0/4] OMAP: PM debug: remove register dump, misc cleanups

2011-06-13 Thread Santosh Shilimkar

On 5/27/2011 4:32 AM, Kevin Hilman wrote:

Inspired by Jean's work to move PM code to modules, I decided it's
time to remove a bunch of ugly and difficult to maintain code from PM
debug.

The main chunk here is removing the register dump features for
OMAP2/OMAP3 which are awful to read, and impossible to scale for
OMAP4+.  Also, there are now some userspace /dev/mem-based tools (like
omapconf) that can handle this type of thing much better, and with a
much better interface and display.

Series applies to v2.6.39.


I have tested this series on V3.0-rc2 as part of OMAP4 PM
series. I think it's ready for merge.

Tested-by: Santosh Shilimkar santosh.shilim...@ti.com
Acked-by: Santosh Shilimkar santosh.shilim...@ti.com


Kevin Hilman (4):
   OMAP3: PM debug: remove sleep_while_idle feature
   OMAP2: PM debug: remove register dumping
   OMAP3: PM debug: remove register dumping
   OMAP2: PM debug: move wakeup timer into clockevent code

  arch/arm/mach-omap2/pm-debug.c|  362 -
  arch/arm/mach-omap2/pm.h  |9 -
  arch/arm/mach-omap2/pm24xx.c  |6 +-
  arch/arm/mach-omap2/pm34xx.c  |6 -
  arch/arm/mach-omap2/timer-gp.c|   33 +++-
  arch/arm/plat-omap/include/plat/dmtimer.h |1 -
  6 files changed, 32 insertions(+), 385 deletions(-)



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCHv5 2/7] HSI: omap_ssi: Introducing OMAP SSI driver

2011-06-13 Thread Tony Lindgren
* Carlos Chinea carlos.chi...@nokia.com [110610 06:41]:
 --- /dev/null
 +++ b/arch/arm/mach-omap2/ssi.c
 +static struct platform_device ssi_pdev = {
 + .name   = omap_ssi,
 + .id = 0,
 + .num_resources  = ARRAY_SIZE(ssi_resources),
 + .resource   = ssi_resources,
 + .dev= {
 + .platform_data  = ssi_pdata,
 + },
 +};
 +
 +int __init omap_ssi_config(struct omap_ssi_board_config *ssi_config)
 +{
 + unsigned int port, offset, cawake_gpio;
 + int err;
 +
 + ssi_pdata.num_ports = ssi_config-num_ports;
 + for (port = 0, offset = 7; port  ssi_config-num_ports;
 + port++, offset += 5) {
 + cawake_gpio = ssi_config-cawake_gpio[port];
 + if (!cawake_gpio)
 + continue; /* Nothing to do */
 + err = gpio_request(cawake_gpio, cawake);
 + if (err  0)
 + goto rback;
 + gpio_direction_input(cawake_gpio);
 + ssi_resources[offset].start = gpio_to_irq(cawake_gpio);
 + ssi_resources[offset].flags = ~IORESOURCE_UNSET;
 + ssi_resources[offset].flags |= IORESOURCE_IRQ_HIGHEDGE |
 + IORESOURCE_IRQ_LOWEDGE;
 + }
 +
 + return 0;
 +rback:
 + dev_err(ssi_pdev.dev, Request cawake (gpio%d) failed\n, cawake_gpio);
 + while (port  0)
 + gpio_free(ssi_config-cawake_gpio[--port]);
 +
 + return err;
 +}
 +
 +static int __init ssi_init(void)
 +{
 + return platform_device_register(ssi_pdev);
 +}
 +subsys_initcall(ssi_init);

Looks like you need something here also to prevent this subsys_initcall
on running on all boards. Maybe have a pointer to ssi_pdev that only
gets initialized after omap_ssi_config?

Then you can have ssi_init fail if no configuration is called:

if (!pdev)
return -ENODEV;

return platform_device_register(pdev);

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/9] OMAP: DSS2: Change DSI platform device name from omapdss_dsi1 to omapdss_dsi

2011-06-13 Thread Tony Lindgren
* Tomi Valkeinen tomi.valkei...@ti.com [110607 06:07]:
 Hi Tony,
 
 On Wed, 2011-05-04 at 12:40 +0300, Tony Lindgren wrote:
  * Archit Taneja arc...@ti.com [110504 10:30]:
   --- a/arch/arm/mach-omap2/board-3430sdp.c
   +++ b/arch/arm/mach-omap2/board-3430sdp.c
   @@ -401,7 +401,7 @@ static struct regulator_consumer_supply 
   sdp3430_vdda_dac_supplies[] = {
/* VPLL2 for digital video outputs */
static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
 REGULATOR_SUPPLY(vdds_dsi, omapdss),
   - REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
   + REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
};

static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
   diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
   b/arch/arm/mach-omap2/board-4430sdp.c
   index 570e83f..eafadb4 100644
   --- a/arch/arm/mach-omap2/board-4430sdp.c
   +++ b/arch/arm/mach-omap2/board-4430sdp.c
   @@ -375,7 +375,7 @@ static struct regulator_consumer_supply 
   sdp4430_vmmc_supply[] = {
};
static struct regulator_consumer_supply sdp4430_vcxio_supply[] = {
 REGULATOR_SUPPLY(vdds_dsi, omapdss_dss),
   - REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
   + REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi.0),
};
  ...
  
  Looks like we should first combine all this cut and paste data
  for each board file into some common init function to cut
  down the crazy churn.
 
 I haven't been able to do this in a clean way. The regulator framework
 is rather static in this area, and adding the data for REGULATOR_SUPPLYs
 dynamically based on OMAP version is something I haven't been able to
 do.
 
 The best option I've found out is defining helper macros to add those
 consumers. An example patch below with 3430sdp and 4430sdp boards
 modified.
 
 This would allow boards to setup the regulators whatever way they want,
 but the 99% of the boards could just use the macros.
 
 It's still not as good as I'd want, because the source regulator is also
 the same for a particular OMAP version for 99% of the boards. So there's
 no real need to use those those macros in the board file, a common
 display file should be able to set everything up. But as I said, I
 haven't found out any way to do this.
 
 What is your opinion of this approach?

Well I guess the macros are a step in the right direction. Eventually
we should have just one istance of the regulator_consumer_supply and
just populate that instead of cloning it in each board file.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] arm: omap3: cm-t35: add support for cm-t3730

2011-06-13 Thread Tony Lindgren
* Igor Grinberg grinb...@compulab.co.il [110603 06:33]:
 
 I'm not sure I understand what are you trying to propose here...
 If you look once again on the code, there is currently only one if 
 (cpu_is_..) {} else {}
 statement currently present.
 (I can remove the if (cpu_is_omap3630()) - it indeed has no value)

 Indeed, there will be some other differences...
 Each time I submit a patch, I try to be as optimal as I can,
 but again I'm open for suggestions...
 (though I think it is optimal, e.g. 33 lines for a new running board...)

What I meant is that maybe you should do the detection first in some
get_revision function and populate the gpio pins there. Sort of like
this recent beagle patch:

https://patchwork.kernel.org/patch/859662/

That way adding support for other differences will be easier.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP4: McBSP: Clear rx_irq at probe time

2011-06-13 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [110608 00:46]:
 Hi Tony,
 
 On Tuesday 31 May 2011 10:57:02 Tony Lindgren wrote:
  Sure, but that's the only option we have to merge any new code.
 
 So this patch will be not taken (even if without this patch OMAP4 McBSP is 
 broken), unless we move the McBSP code out from plat-omap?
 
 I have discussed with Jarkko, and internally about the mcbsp code move. This 
 will certainly take some time to figure out a sane way to do this.
 To be hones I would be surprised if we can do this for 3.1...

Sure we can merge fixes, but let's get the move done before adding
new features.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] OMAP3 IOMMU fixes

2011-06-13 Thread Tony Lindgren
* Laurent Pinchart laurent.pinch...@ideasonboard.com [110608 03:43]:
 Hi Tony,
 
 On Monday 30 May 2011 14:47:07 Laurent Pinchart wrote:
  Hi everybody,
  
  Here are two OMAP3 IOMMU fixes required to support big and/or unaligned
  memory buffers.
  
  Laurent Pinchart (2):
omap3: iovmm: Work around sg_alloc_table size limitation in IOMMU
omap3: iovmm: Support non page-aligned buffers in iommu_vmap
 
 As per Russell comments, the first patch needs more work (or at least more 
 discussions). Could you apply the second patch already ?

It's getting too late for this cycle as this can be counted as
features that never worked type of patch. If it's a regression,
then please specify the commit breaking this suport.

So let's plan on doing the move to drivers and patching whatever is
needed for the upcoming merge window.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap: pandora: fix NAND support

2011-06-13 Thread Tony Lindgren
* Grazvydas Ignotas nota...@gmail.com [110603 13:20]:
 Commit d5ce2b65 omap3630: nand: fix device size to work in polled mode
 changed values for .devsize in nand platform data, now we have to pass
 NAND_BUSWIDTH_16 instead of '1' to select 16bit NAND.
 
 Update pandora's platform data accordingly, also specify appropriate
 transfer type.

Thanks adding to fixes.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] dmaengine: add new api for preparing simple slave transfer

2011-06-13 Thread Linus Walleij
On Fri, Jun 10, 2011 at 3:33 PM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Fri, Jun 10, 2011 at 05:18:46PM +0530, Raju, Sundaram wrote:
 Now DMACs capable of 3D transfer, do transfer of the whole 1D
 buffer per sync received or even whole 2D buffer per sync received
 (based on the sync rate programmed in the DMAC).

 The only issue which I see that we don't cover is the case where you want
 to describe a single buffer which is organised as N bytes to be transferred,
 M following bytes to be skipped, N bytes to be transferred, M bytes to be
 skipped.  I doubt there are many controllers which can be programmed with
 both 'N' and 'M' parameters directly.

Sundaram is this how your controller works?
I mean the hardware can skip over sequences like this?

When we added the config interface to DMAengine I originally included
a custom config call, but Dan wanted me to keep it out until we
had some specific usecase for it. FSLDMA recently started
to use it.

Notice how dmaengine_slave_config() is implemented:

static inline int dmaengine_slave_config(struct dma_chan *chan,
  struct dma_slave_config *config)
{
return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
(unsigned long)config);
}

So what is passed to the driver is just an unsigned long.

This is actually modeled to be ioctl()-like so you can pass in a
custom config to the same callback on the device driver,
just use some other enumerator than DMA_SLAVE_CONFIG,
say like FSLDMA already does with FSLDMA_EXTERNAL_START.

Just put some enumerator in enum dma_ctrl_cmd in
dmaengine.h such as SDMA_TEXAS_STRIDE_CONFIG and call
like this:

/* However that config struct needs to look, basically */
static struct sdma_ti_stride_cgf = {
 take = M,
 skip = N,
};

ret = chan-device-device_control(chan, SDMA_TEXAS_STRIDE_CONFIG,
sdma_ti_stride_cfg);

Or something like this.

Thanks,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


omap3: ftrace on latest 3.0.0-rc2

2011-06-13 Thread Premi, Sanjeev
Hi all,

I am unable to enable ftrace on the 3.0.0-rc2. Have tried with
Codesourcery toolchain using GCC v4.3.3 and 4.5.1.

Before moving to debug, I just wanted to know if it is a known
problem.

~sanjeev

Linux version 3.0.0-rc2-11092-gc04c67c (premi@mylinux) (gcc version 4.5.1
 (Sourcery G++ Lite 2010.09-50) ) #2 SMP Mon Jun 13 15:23:22 IST 2011

[root@OMAP3EVM tracing]# uname -a
Linux OMAP3EVM 3.0.0-rc2-11092-gc04c67c #2 SMP Mon Jun 13 15:23:22 IST 201
1 armv7l GNU/Linux
[root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]# zcat /proc/config.gz | grep TRACER
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_GENERIC_TRACER=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
CONFIG_STACK_TRACER=y
[root@OMAP3EVM tracing]#

[root@OMAP3EVM tracing]# dmesg | grep -i tracer
[0.841461] Testing tracer function: PASSED
[1.932708] Testing tracer function_graph:
[1.933349] Failed to init function_graph tracer, init returned -19
[5.950775] Failed to enable function tracer for event tests
[root@OMAP3EVM tracing]# pwd
root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]# cat available_tracers
nop

Linux version 3.0.0-rc2-11092-gc04c67c (premi@mylinux) (gcc version 4.3.3
 (Sourcery G++ Lite 2009q1-203) ) #3 SMP Mon Jun 13 17:29:19 IST 2011

[5.845520] Testing all events: OK
[5.898864] [ cut here ]
[5.903808] WARNING: at kernel/trace/trace_events.c:1662 event_trace_s
elf_tests_init+0x5c/0x80()
[5.913085] Modules linked in:
[5.916351] [c007ac20] (unwind_backtrace+0x0/0x104) from [c04bbb3c] 
(dump_stack+0x20/0x24)
[5.925476] [c04bbb3c] (dump_stack+0x20/0x24) from [c00b3c78] (warn
_slowpath_common+0x5c/0x74)
[5.934967] [c00b3c78] (warn_slowpath_common+0x5c/0x74) from [c00b3c
bc] (warn_slowpath_null+0x2c/0x34)
[5.945190] [c00b3cbc] (warn_slowpath_null+0x2c/0x34) from [c0020ecc
]
 (event_trace_self_tests_init+0x5c/0x80)
[5.956054] [c0020ecc] (event_trace_self_tests_init+0x5c/0x80) from 
[c0066598] (do_one_initcall+0x44/0x194)
[5.966705] [c0066598] (do_one_initcall+0x44/0x194) from [c0008454]
 (kernel_init+0xbc/0x170)
[5.976013] [c0008454] (kernel_init+0xbc/0x170) from [c0073ab8] (ke
rnel_thread_exit+0x0/0x8)
[5.985321] ---[ end trace 3c0bd3405257eb98 ]---
[5.990203] Failed to enable function tracer for event tests

[root@OMAP3EVM tracing]# uname -a
Linux OMAP3EVM 3.0.0-rc2-11092-gc04c67c #3 SMP Mon Jun 13 17:29:19 IST 2011
 armv7l GNU/Linux
[root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]# cat available_tracers
nop
[root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]#
[root@OMAP3EVM tracing]# zcat /proc/config.gz | grep TRACER
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_GENERIC_TRACER=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_SCHED_TRACER is not set
CONFIG_STACK_TRACER=y
[root@OMAP3EVM tracing]#
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap4: fix build error when undefining CONFIG_SMP

2011-06-13 Thread Tony Lindgren
* Santosh Shilimkar santosh.shilim...@ti.com [110612 23:32]:
 On 6/13/2011 11:55 AM, Vadillo, Miguel wrote:
 
 Function omap_smc2 is undeclared when disabling SMP

Looks like this won't apply to current mainline kernel, care
to check if it's still needed?

Tony

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Alan Stern
On Mon, 13 Jun 2011, Tanya Brokhman wrote:

  
  On Sun, Jun 12, 2011 at 02:14:46PM +0300, Tatyana Brokhman wrote:
   Signed-off-by: Tatyana Brokhman tlin...@codeaurora.org
  
  I need a sensible commit log for this. Why do we need to change all
  min() to min_t() ?
  
 
 Actually, Alan asked me to make this change in one place in dummy_hcd. I
 wasn't aware of the min_t macro before that. So when I searched the code for
 other places I found quite a few and just thought that it would be nicer
 to use min_t() instead of min() with casting. 
 So we don't need to make this change. Everything works as is. This patch
 only makes the code look nicer, nothing more.
 I can elaborate the above in the commit log if you want.

The change I suggested involved replacing two typecasts with a single 
min_t.  All (or almost all) the places this patch touches currently 
contain only one typecast, so the motivation for changing them is a lot 
weaker.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap4: fix build error when undefining CONFIG_SMP

2011-06-13 Thread Santosh Shilimkar

On 6/13/2011 8:05 PM, Tony Lindgren wrote:

* Santosh Shilimkarsantosh.shilim...@ti.com  [110612 23:32]:

On 6/13/2011 11:55 AM, Vadillo, Miguel wrote:


Function omap_smc2 is undeclared when disabling SMP


Looks like this won't apply to current mainline kernel, care
to check if it's still needed?


Yep. After checking, looks like patch isn't generated
against mainline. It's not needed against current mainline.
Sorry for oversight.


Miguel,
Did you post this by mistake ?
Looking at hunks it apears to be needed against
internal tree.

Regards
Santosh

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap4: fix build error when undefining CONFIG_SMP

2011-06-13 Thread Vadillo, Miguel
Yes, sorry about this mistake, the patch its just for an internal tree
and I wasn't careful enough to check the mainline. Sorry about the
noise.

Santosh,

I think is needed in the internal branch p-android-omap-2.6.39

On Mon, Jun 13, 2011 at 9:43 AM, Santosh Shilimkar
santosh.shilim...@ti.com wrote:
 On 6/13/2011 8:05 PM, Tony Lindgren wrote:

 * Santosh Shilimkarsantosh.shilim...@ti.com  [110612 23:32]:

 On 6/13/2011 11:55 AM, Vadillo, Miguel wrote:

 Function omap_smc2 is undeclared when disabling SMP

 Looks like this won't apply to current mainline kernel, care
 to check if it's still needed?

 Yep. After checking, looks like patch isn't generated
 against mainline. It's not needed against current mainline.
 Sorry for oversight.


 Miguel,
 Did you post this by mistake ?
 Looking at hunks it apears to be needed against
 internal tree.

 Regards
 Santosh


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] omap4: fix build error when undefining CONFIG_SMP

2011-06-13 Thread Santosh Shilimkar

On 6/13/2011 8:19 PM, Vadillo, Miguel wrote:

Yes, sorry about this mistake, the patch its just for an internal tree
and I wasn't careful enough to check the mainline. Sorry about the
noise.


Thanks for confirming it.

Regards
Santosh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value to int

2011-06-13 Thread Ghongdemath, Girish
Tomi,
Couple of queries,

On Mon, Jun 13, 2011 at 4:51 AM, Tomi Valkeinen tomi.valkei...@ti.com wrote:
 Paul, can you take this patch and queue it for an rc?

  Tomi

 On Thu, 2011-06-09 at 16:56 +0300, Tomi Valkeinen wrote:
 get_context_loss_count functions return context loss count as u32, and
 zero means an error. However, zero is also returned when context has
 never been lost and could also be returned when the context loss count
 has wrapped and goes to zero.

 Change the functions to return an int, with negative value meaning an
 error.


 +             if (off_mode_enabled) {

- why have a check for off_mode_enabled? As this only detects valid
next state for MPU/CORE. Other pwrdm can still
hit OFF.


 +                     count++;
 +                     /*
 +                      * Context loss count has to be a non-negative value.
 +                      * Clear the sign bit to get a value range from 0 to
 +                      * INT_MAX.
 +                      */
 +                     count = INT_MAX;
 +                     dummy_context_loss_counter = count;
 +             }
       }

- Why not use u32 instead?


Regards,
Girish


       pr_debug(OMAP PM: context loss count for dev %s = %d\n,
 @@ -337,7 +347,7 @@ u32 omap_pm_get_dev_context_loss_count(struct device 
 *dev)

  #else

 -u32 omap_pm_get_dev_context_loss_count(struct device *dev)
 +int omap_pm_get_dev_context_loss_count(struct device *dev)
  {
       return dummy_context_loss_counter;
  }
 diff --git a/arch/arm/plat-omap/omap_device.c 
 b/arch/arm/plat-omap/omap_device.c
 index 9bbda9a..9753f71 100644
 --- a/arch/arm/plat-omap/omap_device.c
 +++ b/arch/arm/plat-omap/omap_device.c
 @@ -310,7 +310,7 @@ static void _add_optional_clock_clkdev(struct 
 omap_device *od,
   * return the context loss counter for that hwmod, otherwise return
   * zero.
   */
 -u32 omap_device_get_context_loss_count(struct platform_device *pdev)
 +int omap_device_get_context_loss_count(struct platform_device *pdev)
  {
       struct omap_device *od;
       u32 ret = 0;


 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 00/18] MFD/ASoC/Input: TWL4030/TWL60X0 changes

2011-06-13 Thread Peter Ujfalusi
Hello,

Changes since v4:
- Comments from Dmitry Torokhov addressed for the twl6030-vibra driver.

Intro message from the v4 series:
The series will do five major things, and they are in one series, because they
pretty much depending on each other, so it is easier to handle them together.

1. Move the common pmic related configurations out from the board files.
New twl-common.c/h file has been created for this purpose.
OMAP3 board files received two patches (pdata, and regualtor changes), OMAP4
board files has been changed with one patch.

2. Rename the twl4030-codec MFD driver to twl4030-audio
Since the ASoC multicomponent introduction (2.6.37) the twl4030-codec MFD dirver
had been using twl4030-audio to register (twl4030-codec is the ASoC codec
driver). The documentation refers to this part of twl as audio block, so it is
better to rename the driver as well to avoid confusion.

3. Introduction of MFD driver for twl6040.
The TWL6040 audio IC has codec and vibra functionality.
Convert the existing ASoC codec driver to use the new MFD driver's interface.

4. Vibrator driver for TWL6040 (Input/ForceFeedback driver)
The driver itself, and support for the vibrators in SDP4430 board.

5. Updates for twl6040 ASoC codec driver
HS ramp configuration, new ABE dais, updated sample rate constraints, SDP4430
configuration.

Regards,
Peter

---
Axel Castaneda Gonzalez (1):
  ASoC: twl6040: Configure ramp step based on platform

Liam Girdwood (3):
  ASoC: twl6040: add all ABE DAIs
  ASoC: twl6040: Support other sample rates in constraints.
  ASoC: twl6040: set default constraints.

Misael Lopez Cruz (5):
  mfd: twl6040: Add initial support
  ASoC: twl6040: Convert into TWL6040 MFD child
  input: Add initial support for TWL6040 vibrator
  ASoC: twl6040: Remove pll and headset mode dependency
  OMAP4: SDP4430: Add twl6040 codec platform support

Peter Ujfalusi (9):
  OMAP: New twl-common for common TWL configuration
  OMAP4: Move common twl6030 configuration to twl-common
  OMAP3: Move common twl configuration to twl-common
  OMAP3: Move common regulator configuration to twl-common
  MFD: twl4030-codec: Rename internals from codec to audio
  MFD: twl4030-codec - twl4030-audio: Rename the driver
  MFD: twl4030-audio: Rename platform data
  MFD: twl6040: Change platform data for soc codec driver
  OMAP4: SDP4430: Add twl6040 vibrator platform support

 arch/arm/mach-omap2/Makefile   |2 +-
 arch/arm/mach-omap2/board-3430sdp.c|   89 +---
 arch/arm/mach-omap2/board-4430sdp.c|  187 ++
 arch/arm/mach-omap2/board-cm-t35.c |   48 +--
 arch/arm/mach-omap2/board-devkit8000.c |   37 +-
 arch/arm/mach-omap2/board-igep0020.c   |   44 +--
 arch/arm/mach-omap2/board-ldp.c|   15 +-
 arch/arm/mach-omap2/board-omap3beagle.c|   60 +--
 arch/arm/mach-omap2/board-omap3evm.c   |   67 +--
 arch/arm/mach-omap2/board-omap3pandora.c   |   59 +--
 arch/arm/mach-omap2/board-omap3stalker.c   |   70 +--
 arch/arm/mach-omap2/board-omap3touchbook.c |   57 +--
 arch/arm/mach-omap2/board-omap4panda.c |  149 +-
 arch/arm/mach-omap2/board-overo.c  |   59 +--
 arch/arm/mach-omap2/board-rm680.c  |8 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c   |   44 +--
 arch/arm/mach-omap2/board-zoom-peripherals.c   |   88 +---
 arch/arm/mach-omap2/common-board-devices.c |   21 -
 arch/arm/mach-omap2/common-board-devices.h |   26 +-
 arch/arm/mach-omap2/twl-common.c   |  304 ++
 arch/arm/mach-omap2/twl-common.h   |   59 ++
 arch/arm/plat-omap/include/plat/irqs.h |   12 +-
 drivers/input/misc/Kconfig |   13 +-
 drivers/input/misc/Makefile|1 +
 drivers/input/misc/twl4030-vibra.c |   12 +-
 drivers/input/misc/twl6040-vibra.c |  425 +
 drivers/mfd/Kconfig|8 +-
 drivers/mfd/Makefile   |3 +-
 drivers/mfd/twl-core.c |   13 +-
 drivers/mfd/twl4030-audio.c|  277 +
 drivers/mfd/twl4030-codec.c|  277 -
 drivers/mfd/twl6040-core.c |  601 +++
 drivers/mfd/twl6040-irq.c  |  205 +++
 include/linux/i2c/twl.h|   25 +-
 .../linux/mfd/{twl4030-codec.h = twl4030-audio.h} |   16 +-
 include/linux/mfd/twl6040.h|  261 
 sound/soc/codecs/Kconfig   |3 +-
 sound/soc/codecs/twl4030.c |   22 +-
 sound/soc/codecs/twl6040.c |  630 
 sound/soc/codecs/twl6040.h |  118 
 sound/soc/omap/sdp3430.c   

[PATCH v5 03/18] OMAP3: Move common twl configuration to twl-common

2011-06-13 Thread Peter Ujfalusi
Reduce the amount of duplicated code by moving the common
configuration for twl4030/5030/tpsxx to the twl-common file.
Use the omap3_pmic_get_config function from board files to
properly configure the PMIC with the common fields.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-3430sdp.c  |   42 ++--
 arch/arm/mach-omap2/board-cm-t35.c   |9 +
 arch/arm/mach-omap2/board-devkit8000.c   |   18 +
 arch/arm/mach-omap2/board-igep0020.c |   20 ++
 arch/arm/mach-omap2/board-ldp.c  |   15 +--
 arch/arm/mach-omap2/board-omap3beagle.c  |   18 +
 arch/arm/mach-omap2/board-omap3evm.c |   24 +--
 arch/arm/mach-omap2/board-omap3pandora.c |   17 +---
 arch/arm/mach-omap2/board-omap3stalker.c |   24 +--
 arch/arm/mach-omap2/board-omap3touchbook.c   |   19 +
 arch/arm/mach-omap2/board-overo.c|   17 +---
 arch/arm/mach-omap2/board-rm680.c|8 +---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   15 +--
 arch/arm/mach-omap2/board-zoom-peripherals.c |   51 +
 arch/arm/mach-omap2/twl-common.c |   53 ++
 arch/arm/mach-omap2/twl-common.h |6 +++
 16 files changed, 99 insertions(+), 257 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 5dac974..4810dcc 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -231,22 +231,6 @@ static void __init omap_3430sdp_init_early(void)
omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
 }
 
-static int sdp3430_batt_table[] = {
-/* 0 C*/
-30800, 29500, 28300, 27100,
-26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
-17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
-11600, 11200, 10800, 10400, 1, 9630,   9280,   8950,   8620,   8310,
-8020,   7730,   7460,   7200,   6950,   6710,   6470,   6250,   6040,   5830,
-5640,   5450,   5260,   5090,   4920,   4760,   4600,   4450,   4310,   4170,
-4040,   3910,   3790,   3670,   3550
-};
-
-static struct twl4030_bci_platform_data sdp3430_bci_data = {
-   .battery_tmp_tbl= sdp3430_batt_table,
-   .tblsize= ARRAY_SIZE(sdp3430_batt_table),
-};
-
 static struct omap2_hsmmc_info mmc[] = {
{
.mmc= 1,
@@ -292,14 +276,6 @@ static struct twl4030_gpio_platform_data sdp3430_gpio_data 
= {
.setup  = sdp3430_twl_gpio_setup,
 };
 
-static struct twl4030_usb_data sdp3430_usb_data = {
-   .usb_mode   = T2_USB_MODE_ULPI,
-};
-
-static struct twl4030_madc_platform_data sdp3430_madc_data = {
-   .irq_line   = 1,
-};
-
 /* regulator consumer mappings */
 
 /* ads7846 on SPI */
@@ -463,24 +439,10 @@ static struct regulator_init_data sdp3430_vpll2 = {
.consumer_supplies  = sdp3430_vpll2_supplies,
 };
 
-static struct twl4030_codec_audio_data sdp3430_audio;
-
-static struct twl4030_codec_data sdp3430_codec = {
-   .audio_mclk = 2600,
-   .audio = sdp3430_audio,
-};
-
 static struct twl4030_platform_data sdp3430_twldata = {
-   .irq_base   = TWL4030_IRQ_BASE,
-   .irq_end= TWL4030_IRQ_END,
-
/* platform_data for children goes here */
-   .bci= sdp3430_bci_data,
.gpio   = sdp3430_gpio_data,
-   .madc   = sdp3430_madc_data,
.keypad = sdp3430_kp_data,
-   .usb= sdp3430_usb_data,
-   .codec  = sdp3430_codec,
 
.vaux1  = sdp3430_vaux1,
.vaux2  = sdp3430_vaux2,
@@ -496,7 +458,11 @@ static struct twl4030_platform_data sdp3430_twldata = {
 static int __init omap3430_i2c_init(void)
 {
/* i2c1 for PMIC only */
+   omap3_pmic_get_config(sdp3430_twldata,
+ TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
+ TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 0);
omap3_pmic_init(twl4030, sdp3430_twldata);
+
/* i2c2 on camera connector (for sensor control) and optional isp1301 */
omap_register_i2c_bus(2, 400, NULL, 0);
/* i2c3 on display connector (for DVI, tfp410) */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index 77456de..e867474 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -410,10 +410,6 @@ static struct regulator_init_data cm_t35_vpll2 = {
.consumer_supplies  = cm_t35_vdvi_supply,
 };
 
-static struct twl4030_usb_data cm_t35_usb_data = {
-   .usb_mode   = T2_USB_MODE_ULPI,
-};
-
 static uint32_t cm_t35_keymap[] = {
KEY(0, 0, KEY_A),   KEY(0, 1, KEY_B),   KEY(0, 2, KEY_LEFT),
KEY(1, 0, KEY_UP),  KEY(1, 1, KEY_ENTER),   KEY(1, 2, KEY_DOWN),
@@ -496,12 +492,8 @@ 

[PATCH v5 07/18] MFD: twl4030-audio: Rename platform data

2011-06-13 Thread Peter Ujfalusi
Allign the platform data names for twl4030 audio submodule:
twl4030_audio_data: for the core MFD driver
twl4030_codec_data: for ASoC codec driver
twl4030_vibra_data: for the input/ForceFeedback driver

To avoid breakage, change all depending drivers, files
to use the new types.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |6 +++---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   10 +-
 arch/arm/mach-omap2/twl-common.c |   10 +-
 drivers/input/misc/twl4030-vibra.c   |2 +-
 drivers/mfd/twl-core.c   |8 
 drivers/mfd/twl4030-audio.c  |8 
 include/linux/i2c/twl.h  |   12 ++--
 sound/soc/codecs/twl4030.c   |6 +++---
 sound/soc/codecs/twl6040.c   |2 +-
 9 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index dfaf874..a2d3e19 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -738,11 +738,11 @@ static struct twl4030_power_data rx51_t2scripts_data 
__initdata = {
.resource_config = twl4030_rconfig,
 };
 
-struct twl4030_codec_vibra_data rx51_vibra_data __initdata = {
+struct twl4030_vibra_data rx51_vibra_data __initdata = {
.coexist= 0,
 };
 
-struct twl4030_codec_data rx51_codec_data __initdata = {
+struct twl4030_audio_data rx51_audio_data __initdata = {
.audio_mclk = 2600,
.vibra  = rx51_vibra_data,
 };
@@ -752,7 +752,7 @@ static struct twl4030_platform_data rx51_twldata __initdata 
= {
.gpio   = rx51_gpio_data,
.keypad = rx51_kp_data,
.power  = rx51_t2scripts_data,
-   .codec  = rx51_codec_data,
+   .audio  = rx51_audio_data,
 
.vaux1  = rx51_vaux1,
.vaux2  = rx51_vaux2,
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c 
b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 8853dc4..6d44409 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -282,12 +282,12 @@ static int __init omap_i2c_init(void)
TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
 
if (machine_is_omap_zoom2()) {
-   struct twl4030_codec_audio_data *audio_data;
-   audio_data = zoom_twldata.codec-audio;
+   struct twl4030_codec_data *codec_data;
+   codec_data = zoom_twldata.audio-codec;
 
-   audio_data-ramp_delay_value = 3;   /* 161 ms */
-   audio_data-hs_extmute = 1;
-   audio_data-set_hs_extmute = zoom2_set_hs_extmute;
+   codec_data-ramp_delay_value = 3;   /* 161 ms */
+   codec_data-hs_extmute = 1;
+   codec_data-set_hs_extmute = zoom2_set_hs_extmute;
}
omap_pmic_init(1, 2400, twl5030, INT_34XX_SYS_NIRQ, zoom_twldata);
omap_register_i2c_bus(2, 400, NULL, 0);
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index f15f880..ca219ea 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -80,11 +80,11 @@ static struct twl4030_madc_platform_data omap3_madc_pdata = 
{
.irq_line   = 1,
 };
 
-static struct twl4030_codec_audio_data omap3_audio;
+static struct twl4030_codec_data omap3_codec;
 
-static struct twl4030_codec_data omap3_codec_pdata = {
+static struct twl4030_audio_data omap3_audio_pdata = {
.audio_mclk = 2600,
-   .audio = omap3_audio,
+   .codec = omap3_codec,
 };
 
 static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
@@ -292,8 +292,8 @@ void __init omap3_pmic_get_config(struct 
twl4030_platform_data *pmic_data,
if (pdata_flags  TWL_COMMON_PDATA_MADC  !pmic_data-madc)
pmic_data-madc = omap3_madc_pdata;
 
-   if (pdata_flags  TWL_COMMON_PDATA_AUDIO  !pmic_data-codec)
-   pmic_data-codec = omap3_codec_pdata;
+   if (pdata_flags  TWL_COMMON_PDATA_AUDIO  !pmic_data-audio)
+   pmic_data-audio = omap3_audio_pdata;
 
/* Common regulator configurations */
if (regulators_flags  TWL_COMMON_REGULATOR_VDAC  !pmic_data-vdac)
diff --git a/drivers/input/misc/twl4030-vibra.c 
b/drivers/input/misc/twl4030-vibra.c
index 7abca85..3c1a432 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -196,7 +196,7 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
 
 static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
 {
-   struct twl4030_codec_vibra_data *pdata = pdev-dev.platform_data;
+   struct twl4030_vibra_data *pdata = pdev-dev.platform_data;

[PATCH v5 15/18] ASoC: twl6040: Remove pll and headset mode dependency

2011-06-13 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Remove dependency between pll (hppll, lppll) and headset power
mode (low-power, high-performance), as headset power mode can
be used with any pll.

A new control is created to allow headset power mode configuration
from userspace. Changing headset power mode during earpiece related
usecases is not allowed as earpiece requires HS DAC in HP mode.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c |   64 +--
 1 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 7845cdb..d334d86 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -79,6 +79,8 @@ struct twl6040_data {
int codec_powered;
int pll;
int non_lp;
+   int power_mode_forced;
+   int headset_mode;
unsigned int clk_in;
unsigned int sysclk;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
@@ -651,15 +653,26 @@ static int twl6040_power_mode_event(struct 
snd_soc_dapm_widget *w,
 {
struct snd_soc_codec *codec = w-codec;
struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
+   int ret = 0;
 
-   if (SND_SOC_DAPM_EVENT_ON(event))
+   if (SND_SOC_DAPM_EVENT_ON(event)) {
priv-non_lp++;
-   else
+   if (!strcmp(w-name, Earphone Driver)) {
+   /* Earphone doesn't support low power mode */
+   priv-power_mode_forced = 1;
+   ret = headset_power_mode(codec, 1);
+   }
+   } else {
priv-non_lp--;
+   if (!strcmp(w-name, Earphone Driver)) {
+   priv-power_mode_forced = 0;
+   ret = headset_power_mode(codec, priv-headset_mode);
+   }
+   }
 
msleep(1);
 
-   return 0;
+   return ret;
 }
 
 static void twl6040_hs_jack_report(struct snd_soc_codec *codec,
@@ -964,6 +977,44 @@ static const struct snd_kcontrol_new hfr_mux_controls =
 static const struct snd_kcontrol_new ep_driver_switch_controls =
SOC_DAPM_SINGLE(Switch, TWL6040_REG_EARCTL, 0, 1, 0);
 
+/* Headset power mode */
+static const char *twl6040_headset_power_texts[] = {
+   Low-Power, High-Perfomance,
+};
+
+static const struct soc_enum twl6040_headset_power_enum =
+   SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl6040_headset_power_texts),
+   twl6040_headset_power_texts);
+
+static int twl6040_headset_power_get_enum(struct snd_kcontrol *kcontrol,
+   struct snd_ctl_elem_value *ucontrol)
+{
+   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+   struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
+
+   ucontrol-value.enumerated.item[0] = priv-headset_mode;
+
+   return 0;
+}
+
+static int twl6040_headset_power_put_enum(struct snd_kcontrol *kcontrol,
+   struct snd_ctl_elem_value *ucontrol)
+{
+   struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+   struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
+   int high_perf = ucontrol-value.enumerated.item[0];
+   int ret;
+
+   if (priv-power_mode_forced)
+   return -EPERM;
+
+   ret = headset_power_mode(codec, high_perf);
+   if (!ret)
+   priv-headset_mode = high_perf;
+
+   return ret;
+}
+
 static const struct snd_kcontrol_new twl6040_snd_controls[] = {
/* Capture gains */
SOC_DOUBLE_TLV(Capture Preamplifier Volume,
@@ -982,6 +1033,10 @@ static const struct snd_kcontrol_new 
twl6040_snd_controls[] = {
TWL6040_REG_HFLGAIN, TWL6040_REG_HFRGAIN, 0, 0x1D, 1, hf_tlv),
SOC_SINGLE_TLV(Earphone Playback Volume,
TWL6040_REG_EARCTL, 1, 0xF, 1, ep_tlv),
+
+   SOC_ENUM_EXT(Headset Power Mode, twl6040_headset_power_enum,
+   twl6040_headset_power_get_enum,
+   twl6040_headset_power_put_enum),
 };
 
 static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
@@ -1450,6 +1505,9 @@ static int twl6040_probe(struct snd_soc_codec *codec)
priv-codec = codec;
codec-control_data = dev_get_drvdata(codec-dev-parent);
 
+   /* default is high-performance mode */
+   priv-headset_mode = 1;
+
priv-workqueue = create_singlethread_workqueue(twl6040-codec);
if (!priv-workqueue) {
ret = -ENOMEM;
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 17/18] ASoC: twl6040: Configure ramp step based on platform

2011-06-13 Thread Peter Ujfalusi
From: Axel Castaneda Gonzalez x0055...@ti.com

Enable ramp down/up step to be configured based on
platform.

Signed-off-by: Axel Castaneda Gonzalez x0055...@ti.com
Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 include/linux/i2c/twl.h|4 ++
 sound/soc/codecs/twl6040.c |   91 ++--
 2 files changed, 75 insertions(+), 20 deletions(-)

diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 685fd76..114c0f6 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -664,6 +664,10 @@ struct twl4030_codec_data {
unsigned int check_defaults:1;
unsigned int reset_registers:1;
unsigned int hs_extmute:1;
+   u16 hs_left_step;
+   u16 hs_right_step;
+   u16 hf_left_step;
+   u16 hf_right_step;
void (*set_hs_extmute)(int mute);
 };
 
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 3c0d8da..f31a428 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -83,6 +83,10 @@ struct twl6040_data {
int headset_mode;
unsigned int clk_in;
unsigned int sysclk;
+   u16 hs_left_step;
+   u16 hs_right_step;
+   u16 hf_left_step;
+   u16 hf_right_step;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
struct twl6040_jack_data hs_jack;
struct snd_soc_codec *codec;
@@ -339,7 +343,11 @@ static inline int twl6040_hs_ramp_step(struct 
snd_soc_codec *codec,
if (headset-ramp == TWL6040_RAMP_UP) {
/* ramp step up */
if (val  headset-left_vol) {
-   val += left_step;
+   if (val + left_step  headset-left_vol)
+   val = headset-left_vol;
+   else
+   val += left_step;
+
reg = ~TWL6040_HSL_VOL_MASK;
twl6040_write(codec, TWL6040_REG_HSGAIN,
(reg | (~val  TWL6040_HSL_VOL_MASK)));
@@ -349,7 +357,11 @@ static inline int twl6040_hs_ramp_step(struct 
snd_soc_codec *codec,
} else if (headset-ramp == TWL6040_RAMP_DOWN) {
/* ramp step down */
if (val  0x0) {
-   val -= left_step;
+   if ((int)val - (int)left_step  0)
+   val = 0;
+   else
+   val -= left_step;
+
reg = ~TWL6040_HSL_VOL_MASK;
twl6040_write(codec, TWL6040_REG_HSGAIN, reg |
(~val  TWL6040_HSL_VOL_MASK));
@@ -366,7 +378,11 @@ static inline int twl6040_hs_ramp_step(struct 
snd_soc_codec *codec,
if (headset-ramp == TWL6040_RAMP_UP) {
/* ramp step up */
if (val  headset-right_vol) {
-   val += right_step;
+   if (val + right_step  headset-right_vol)
+   val = headset-right_vol;
+   else
+   val += right_step;
+
reg = ~TWL6040_HSR_VOL_MASK;
twl6040_write(codec, TWL6040_REG_HSGAIN,
(reg | (~val  TWL6040_HSR_VOL_SHIFT)));
@@ -376,7 +392,11 @@ static inline int twl6040_hs_ramp_step(struct 
snd_soc_codec *codec,
} else if (headset-ramp == TWL6040_RAMP_DOWN) {
/* ramp step down */
if (val  0x0) {
-   val -= right_step;
+   if ((int)val - (int)right_step  0)
+   val = 0;
+   else
+   val -= right_step;
+
reg = ~TWL6040_HSR_VOL_MASK;
twl6040_write(codec, TWL6040_REG_HSGAIN,
 reg | (~val  TWL6040_HSR_VOL_SHIFT));
@@ -407,7 +427,11 @@ static inline int twl6040_hf_ramp_step(struct 
snd_soc_codec *codec,
if (handsfree-ramp == TWL6040_RAMP_UP) {
/* ramp step up */
if (val  handsfree-left_vol) {
-   val += left_step;
+   if (val + left_step  handsfree-left_vol)
+   val = handsfree-left_vol;
+   else
+   val += left_step;
+
reg = ~TWL6040_HF_VOL_MASK;
twl6040_write(codec, TWL6040_REG_HFLGAIN,
reg | (0x1D - val));
@@ -417,7 +441,11 @@ static inline int twl6040_hf_ramp_step(struct 
snd_soc_codec *codec,
} else if (handsfree-ramp == TWL6040_RAMP_DOWN) {
/* ramp step down */
if (val  0) {
-   val -= left_step;
+   if ((int)val - 

[PATCH v5 09/18] ASoC: twl6040: Convert into TWL6040 MFD child

2011-06-13 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Convert TWL6040 CODEC driver into a TWL6040 MFD child, it implies
that MFD-level operations like register accesses, clock setting
and power management are done through MFD APIs, not directly by
CODEC driver anymore. To avoid conflicts with the other MFD child,
vibrator registers are skipped in CODEC driver.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
---
 sound/soc/codecs/Kconfig   |1 +
 sound/soc/codecs/twl6040.c |  425 +---
 sound/soc/codecs/twl6040.h |  118 
 sound/soc/omap/sdp4430.c   |2 +
 4 files changed, 90 insertions(+), 456 deletions(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 0002220..922f59f 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -240,6 +240,7 @@ config SND_SOC_TWL4030
tristate
 
 config SND_SOC_TWL6040
+   select TWL6040_CORE
tristate
 
 config SND_SOC_UDA134X
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index ade6616..a20e293 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -24,11 +24,10 @@
 #include linux/init.h
 #include linux/delay.h
 #include linux/pm.h
-#include linux/i2c.h
-#include linux/gpio.h
 #include linux/platform_device.h
 #include linux/slab.h
 #include linux/i2c/twl.h
+#include linux/mfd/twl6040.h
 
 #include sound/core.h
 #include sound/pcm.h
@@ -77,14 +76,12 @@ struct twl6040_jack_data {
 
 /* codec private data */
 struct twl6040_data {
-   int audpwron;
-   int naudint;
int codec_powered;
int pll;
int non_lp;
+   unsigned int clk_in;
unsigned int sysclk;
struct snd_pcm_hw_constraint_list *sysclk_constraints;
-   struct completion ready;
struct twl6040_jack_data hs_jack;
struct snd_soc_codec *codec;
struct workqueue_struct *workqueue;
@@ -239,12 +236,13 @@ static inline void twl6040_write_reg_cache(struct 
snd_soc_codec *codec,
 static int twl6040_read_reg_volatile(struct snd_soc_codec *codec,
unsigned int reg)
 {
+   struct twl6040 *twl6040 = codec-control_data;
u8 value;
 
if (reg = TWL6040_CACHEREGNUM)
return -EIO;
 
-   twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, value, reg);
+   value = twl6040_reg_read(twl6040, reg);
twl6040_write_reg_cache(codec, reg, value);
 
return value;
@@ -256,11 +254,13 @@ static int twl6040_read_reg_volatile(struct snd_soc_codec 
*codec,
 static int twl6040_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int value)
 {
+   struct twl6040 *twl6040 = codec-control_data;
+
if (reg = TWL6040_CACHEREGNUM)
return -EIO;
 
twl6040_write_reg_cache(codec, reg, value);
-   return twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, value, reg);
+   return twl6040_reg_write(twl6040, reg, value);
 }
 
 static void twl6040_init_vio_regs(struct snd_soc_codec *codec)
@@ -268,15 +268,21 @@ static void twl6040_init_vio_regs(struct snd_soc_codec 
*codec)
u8 *cache = codec-reg_cache;
int reg, i;
 
-   /* allow registers to be accessed by i2c */
-   twl6040_write(codec, TWL6040_REG_ACCCTL, cache[TWL6040_REG_ACCCTL]);
-
for (i = 0; i  TWL6040_VIOREGNUM; i++) {
reg = twl6040_vio_reg[i];
-   /* skip read-only registers (ASICID, ASICREV, STATUS) */
+   /*
+* skip read-only registers (ASICID, ASICREV, STATUS)
+* and registers shared among MFD children
+*/
switch (reg) {
case TWL6040_REG_ASICID:
case TWL6040_REG_ASICREV:
+   case TWL6040_REG_INTID:
+   case TWL6040_REG_INTMR:
+   case TWL6040_REG_NCPCTL:
+   case TWL6040_REG_LDOCTL:
+   case TWL6040_REG_GPOCTL:
+   case TWL6040_REG_ACCCTL:
case TWL6040_REG_STATUS:
continue;
default:
@@ -293,6 +299,20 @@ static void twl6040_init_vdd_regs(struct snd_soc_codec 
*codec)
 
for (i = 0; i  TWL6040_VDDREGNUM; i++) {
reg = twl6040_vdd_reg[i];
+   /* skip vibra and PLL registers */
+   switch (reg) {
+   case TWL6040_REG_VIBCTLL:
+   case TWL6040_REG_VIBDATL:
+   case TWL6040_REG_VIBCTLR:
+   case TWL6040_REG_VIBDATR:
+   case TWL6040_REG_HPPLLCTL:
+   case TWL6040_REG_LPPLLCTL:
+   case TWL6040_REG_LPPLLDIV:
+   continue;
+   default:
+   break;
+   }
+
twl6040_write(codec, reg, cache[reg]);
}
 }
@@ -596,88 +616,6 @@ static int pga_event(struct 

[PATCH v5 01/18] OMAP: New twl-common for common TWL configuration

2011-06-13 Thread Peter Ujfalusi
Introduce a new file, which will be used to configure
common pmic (TWL) devices, regulators, and TWL audio.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/Makefile   |2 +-
 arch/arm/mach-omap2/common-board-devices.c |   21 -
 arch/arm/mach-omap2/common-board-devices.h |   26 +--
 arch/arm/mach-omap2/twl-common.c   |   46 
 arch/arm/mach-omap2/twl-common.h   |   28 +
 5 files changed, 77 insertions(+), 46 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl-common.c
 create mode 100644 arch/arm/mach-omap2/twl-common.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b148077..fee192e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -269,4 +269,4 @@ obj-$(CONFIG_ARCH_OMAP4)+= hwspinlock.o
 disp-$(CONFIG_OMAP2_DSS)   := display.o
 obj-y  += $(disp-m) $(disp-y)
 
-obj-y  += common-board-devices.o
+obj-y  += common-board-devices.o twl-common.o
diff --git a/arch/arm/mach-omap2/common-board-devices.c 
b/arch/arm/mach-omap2/common-board-devices.c
index 94ccf46..5e03b2e 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -20,36 +20,15 @@
  *
  */
 
-#include linux/i2c.h
-#include linux/i2c/twl.h
-
 #include linux/gpio.h
 #include linux/spi/spi.h
 #include linux/spi/ads7846.h
 
-#include plat/i2c.h
 #include plat/mcspi.h
 #include plat/nand.h
 
 #include common-board-devices.h
 
-static struct i2c_board_info __initdata pmic_i2c_board_info = {
-   .addr   = 0x48,
-   .flags  = I2C_CLIENT_WAKE,
-};
-
-void __init omap_pmic_init(int bus, u32 clkrate,
-  const char *pmic_type, int pmic_irq,
-  struct twl4030_platform_data *pmic_data)
-{
-   strncpy(pmic_i2c_board_info.type, pmic_type,
-   sizeof(pmic_i2c_board_info.type));
-   pmic_i2c_board_info.irq = pmic_irq;
-   pmic_i2c_board_info.platform_data = pmic_data;
-
-   omap_register_i2c_bus(bus, clkrate, pmic_i2c_board_info, 1);
-}
-
 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
 static struct omap2_mcspi_device_config ads7846_mcspi_config = {
diff --git a/arch/arm/mach-omap2/common-board-devices.h 
b/arch/arm/mach-omap2/common-board-devices.h
index 6797190..a0b4a428 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -1,33 +1,11 @@
 #ifndef __OMAP_COMMON_BOARD_DEVICES__
 #define __OMAP_COMMON_BOARD_DEVICES__
 
+#include twl-common.h
+
 #define NAND_BLOCK_SIZESZ_128K
 
-struct twl4030_platform_data;
 struct mtd_partition;
-
-void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
-   struct twl4030_platform_data *pmic_data);
-
-static inline void omap2_pmic_init(const char *pmic_type,
-  struct twl4030_platform_data *pmic_data)
-{
-   omap_pmic_init(2, 2600, pmic_type, INT_24XX_SYS_NIRQ, pmic_data);
-}
-
-static inline void omap3_pmic_init(const char *pmic_type,
-  struct twl4030_platform_data *pmic_data)
-{
-   omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
-}
-
-static inline void omap4_pmic_init(const char *pmic_type,
-  struct twl4030_platform_data *pmic_data)
-{
-   /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
-   omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
-}
-
 struct ads7846_platform_data;
 
 void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
new file mode 100644
index 000..4f7b24c
--- /dev/null
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -0,0 +1,46 @@
+/*
+ * twl-common.c
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc..
+ * Author: Peter Ujfalusi peter.ujfal...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include linux/i2c.h
+#include linux/i2c/twl.h
+#include linux/gpio.h
+
+#include plat/i2c.h
+
+#include twl-common.h
+
+static struct 

[PATCH v5 02/18] OMAP4: Move common twl6030 configuration to twl-common

2011-06-13 Thread Peter Ujfalusi
Reduce the amount of duplicated code by moving the common
configuration for TWL6030 (on OMAP4 platform) to the
twl-common file.
Use the omap4_pmic_get_config function from board files to
properly configure the PMIC with the common fields.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c|  143 ++--
 arch/arm/mach-omap2/board-omap4panda.c |  149 +++---
 arch/arm/mach-omap2/twl-common.c   |  163 
 arch/arm/mach-omap2/twl-common.h   |   20 
 4 files changed, 205 insertions(+), 270 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 63de2d3..968029a 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -306,14 +306,6 @@ static struct omap_musb_board_data musb_board_data = {
.power  = 100,
 };
 
-static struct twl4030_usb_data omap4_usbphy_data = {
-   .phy_init   = omap4430_phy_init,
-   .phy_exit   = omap4430_phy_exit,
-   .phy_power  = omap4430_phy_power,
-   .phy_set_clock  = omap4430_phy_set_clk,
-   .phy_suspend= omap4430_phy_suspend,
-};
-
 static struct omap2_hsmmc_info mmc[] = {
{
.mmc= 2,
@@ -338,12 +330,6 @@ static struct regulator_consumer_supply 
sdp4430_vaux_supply[] = {
.dev_name = omap_hsmmc.1,
},
 };
-static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
-   {
-   .supply = vmmc,
-   .dev_name = omap_hsmmc.0,
-   },
-};
 
 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 {
@@ -403,61 +389,6 @@ static struct regulator_init_data sdp4430_vaux1 = {
.consumer_supplies  = sdp4430_vaux_supply,
 };
 
-static struct regulator_init_data sdp4430_vaux2 = {
-   .constraints = {
-   .min_uV = 120,
-   .max_uV = 280,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-static struct regulator_init_data sdp4430_vaux3 = {
-   .constraints = {
-   .min_uV = 100,
-   .max_uV = 300,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-/* VMMC1 for MMC1 card */
-static struct regulator_init_data sdp4430_vmmc = {
-   .constraints = {
-   .min_uV = 120,
-   .max_uV = 300,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = 1,
-   .consumer_supplies  = sdp4430_vmmc_supply,
-};
-
-static struct regulator_init_data sdp4430_vpp = {
-   .constraints = {
-   .min_uV = 180,
-   .max_uV = 250,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_VOLTAGE
-   | REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
 static struct regulator_init_data sdp4430_vusim = {
.constraints = {
.min_uV = 120,
@@ -471,74 +402,10 @@ static struct regulator_init_data sdp4430_vusim = {
},
 };
 
-static struct regulator_init_data sdp4430_vana = {
-   .constraints = {
-   .min_uV = 210,
-   .max_uV = 210,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask  = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-};
-
-static struct regulator_init_data sdp4430_vcxio = {
-   .constraints = {
-   

[PATCH v5 04/18] OMAP3: Move common regulator configuration to twl-common

2011-06-13 Thread Peter Ujfalusi
Some regulator config can be moved out from board files,
since they are close to identical.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-3430sdp.c  |   51 --
 arch/arm/mach-omap2/board-cm-t35.c   |   41 +++--
 arch/arm/mach-omap2/board-devkit8000.c   |   21 +--
 arch/arm/mach-omap2/board-igep0020.c |   28 +++
 arch/arm/mach-omap2/board-omap3beagle.c  |   44 ++
 arch/arm/mach-omap2/board-omap3evm.c |   47 +++-
 arch/arm/mach-omap2/board-omap3pandora.c |   44 --
 arch/arm/mach-omap2/board-omap3stalker.c |   48 +++-
 arch/arm/mach-omap2/board-omap3touchbook.c   |   40 
 arch/arm/mach-omap2/board-overo.c|   44 ++
 arch/arm/mach-omap2/board-rx51-peripherals.c |   25 ++---
 arch/arm/mach-omap2/board-zoom-peripherals.c |   41 ++---
 arch/arm/mach-omap2/twl-common.c |   42 +
 arch/arm/mach-omap2/twl-common.h |5 +++
 14 files changed, 109 insertions(+), 412 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c 
b/arch/arm/mach-omap2/board-3430sdp.c
index 4810dcc..d944a56 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -283,16 +283,6 @@ static struct regulator_consumer_supply 
sdp3430_vaux3_supplies[] = {
REGULATOR_SUPPLY(vcc, spi1.0),
 };
 
-static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
-   REGULATOR_SUPPLY(vdda_dac, omapdss_venc),
-};
-
-/* VPLL2 for digital video outputs */
-static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
-   REGULATOR_SUPPLY(vdds_dsi, omapdss),
-   REGULATOR_SUPPLY(vdds_dsi, omapdss_dsi1),
-};
-
 static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
REGULATOR_SUPPLY(vmmc, omap_hsmmc.0),
 };
@@ -409,36 +399,6 @@ static struct regulator_init_data sdp3430_vsim = {
.consumer_supplies  = sdp3430_vsim_supplies,
 };
 
-/* VDAC for DSS driving S-Video */
-static struct regulator_init_data sdp3430_vdac = {
-   .constraints = {
-   .min_uV = 180,
-   .max_uV = 180,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
-   .consumer_supplies  = sdp3430_vdda_dac_supplies,
-};
-
-static struct regulator_init_data sdp3430_vpll2 = {
-   .constraints = {
-   .name   = VDVI,
-   .min_uV = 180,
-   .max_uV = 180,
-   .apply_uV   = true,
-   .valid_modes_mask   = REGULATOR_MODE_NORMAL
-   | REGULATOR_MODE_STANDBY,
-   .valid_ops_mask = REGULATOR_CHANGE_MODE
-   | REGULATOR_CHANGE_STATUS,
-   },
-   .num_consumer_supplies  = ARRAY_SIZE(sdp3430_vpll2_supplies),
-   .consumer_supplies  = sdp3430_vpll2_supplies,
-};
-
 static struct twl4030_platform_data sdp3430_twldata = {
/* platform_data for children goes here */
.gpio   = sdp3430_gpio_data,
@@ -451,16 +411,19 @@ static struct twl4030_platform_data sdp3430_twldata = {
.vmmc1  = sdp3430_vmmc1,
.vmmc2  = sdp3430_vmmc2,
.vsim   = sdp3430_vsim,
-   .vdac   = sdp3430_vdac,
-   .vpll2  = sdp3430_vpll2,
 };
 
 static int __init omap3430_i2c_init(void)
 {
/* i2c1 for PMIC only */
omap3_pmic_get_config(sdp3430_twldata,
- TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
- TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO, 0);
+   TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_BCI |
+   TWL_COMMON_PDATA_MADC | TWL_COMMON_PDATA_AUDIO,
+   TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
+   sdp3430_twldata.vdac-constraints.apply_uV = true;
+   sdp3430_twldata.vpll2-constraints.apply_uV = true;
+   sdp3430_twldata.vpll2-constraints.name = VDVI;
+
omap3_pmic_init(twl4030, sdp3430_twldata);
 
/* i2c2 on camera connector (for sensor control) and optional isp1301 */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c 
b/arch/arm/mach-omap2/board-cm-t35.c
index e867474..2ae6afe 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -345,9 +345,6 @@ static struct 

[PATCH v5 05/18] MFD: twl4030-codec: Rename internals from codec to audio

2011-06-13 Thread Peter Ujfalusi
In preparation of renaming the driver from twl4030-codec
to twl4030-audio, first do some clean ups in the driver,
which does not cause any problems outside.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/mfd/twl4030-codec.c |  135 ++-
 1 files changed, 68 insertions(+), 67 deletions(-)

diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-codec.c
index 2bf4136..e1782b3 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-codec.c
@@ -1,5 +1,6 @@
 /*
- * MFD driver for twl4030 codec submodule
+ * MFD driver for twl4030 audio submodule, which contains an audio codec, and
+ * the vibra control.
  *
  * Author: Peter Ujfalusi peter.ujfal...@ti.com
  *
@@ -31,53 +32,53 @@
 #include linux/mfd/core.h
 #include linux/mfd/twl4030-codec.h
 
-#define TWL4030_CODEC_CELLS2
+#define TWL4030_AUDIO_CELLS2
 
-static struct platform_device *twl4030_codec_dev;
+static struct platform_device *twl4030_audio_dev;
 
-struct twl4030_codec_resource {
+struct twl4030_audio_resource {
int request_count;
u8 reg;
u8 mask;
 };
 
-struct twl4030_codec {
+struct twl4030_audio {
unsigned int audio_mclk;
struct mutex mutex;
-   struct twl4030_codec_resource resource[TWL4030_CODEC_RES_MAX];
-   struct mfd_cell cells[TWL4030_CODEC_CELLS];
+   struct twl4030_audio_resource resource[TWL4030_CODEC_RES_MAX];
+   struct mfd_cell cells[TWL4030_AUDIO_CELLS];
 };
 
 /*
  * Modify the resource, the function returns the content of the register
  * after the modification.
  */
-static int twl4030_codec_set_resource(enum twl4030_codec_res id, int enable)
+static int twl4030_audio_set_resource(enum twl4030_codec_res id, int enable)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
u8 val;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, val,
-   codec-resource[id].reg);
+   audio-resource[id].reg);
 
if (enable)
-   val |= codec-resource[id].mask;
+   val |= audio-resource[id].mask;
else
-   val = ~codec-resource[id].mask;
+   val = ~audio-resource[id].mask;
 
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
-   val, codec-resource[id].reg);
+   val, audio-resource[id].reg);
 
return val;
 }
 
-static inline int twl4030_codec_get_resource(enum twl4030_codec_res id)
+static inline int twl4030_audio_get_resource(enum twl4030_codec_res id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
u8 val;
 
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, val,
-   codec-resource[id].reg);
+   audio-resource[id].reg);
 
return val;
 }
@@ -88,24 +89,24 @@ static inline int twl4030_codec_get_resource(enum 
twl4030_codec_res id)
  */
 int twl4030_codec_enable_resource(enum twl4030_codec_res id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val;
 
if (id = TWL4030_CODEC_RES_MAX) {
-   dev_err(twl4030_codec_dev-dev,
+   dev_err(twl4030_audio_dev-dev,
Invalid resource ID (%u)\n, id);
return -EINVAL;
}
 
-   mutex_lock(codec-mutex);
-   if (!codec-resource[id].request_count)
+   mutex_lock(audio-mutex);
+   if (!audio-resource[id].request_count)
/* Resource was disabled, enable it */
-   val = twl4030_codec_set_resource(id, 1);
+   val = twl4030_audio_set_resource(id, 1);
else
-   val = twl4030_codec_get_resource(id);
+   val = twl4030_audio_get_resource(id);
 
-   codec-resource[id].request_count++;
-   mutex_unlock(codec-mutex);
+   audio-resource[id].request_count++;
+   mutex_unlock(audio-mutex);
 
return val;
 }
@@ -117,31 +118,31 @@ EXPORT_SYMBOL_GPL(twl4030_codec_enable_resource);
  */
 int twl4030_codec_disable_resource(unsigned id)
 {
-   struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
+   struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev);
int val;
 
if (id = TWL4030_CODEC_RES_MAX) {
-   dev_err(twl4030_codec_dev-dev,
+   dev_err(twl4030_audio_dev-dev,
Invalid resource ID (%u)\n, id);
return -EINVAL;
}
 
-   mutex_lock(codec-mutex);
-   if (!codec-resource[id].request_count) {
-   dev_err(twl4030_codec_dev-dev,
+   mutex_lock(audio-mutex);
+   if 

[PATCH v5 11/18] input: Add initial support for TWL6040 vibrator

2011-06-13 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Add twl6040_vibra as a child of MFD device twl6040_codec. This
implementation covers the PCM-to-PWM mode of TWL6040 vibrator
module.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/input/misc/Kconfig |   11 +
 drivers/input/misc/Makefile|1 +
 drivers/input/misc/twl6040-vibra.c |  425 
 include/linux/i2c/twl.h|8 +
 4 files changed, 445 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/twl6040-vibra.c

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 077309a..d1bf872 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -275,6 +275,17 @@ config INPUT_TWL4030_VIBRA
  To compile this driver as a module, choose M here. The module will
  be called twl4030_vibra.
 
+config INPUT_TWL6040_VIBRA
+   tristate Support for TWL6040 Vibrator
+   depends on TWL4030_CORE
+   select TWL6040_CORE
+   select INPUT_FF_MEMLESS
+   help
+ This option enables support for TWL6040 Vibrator Driver.
+
+ To compile this driver as a module, choose M here. The module will
+ be called twl6040_vibra.
+
 config INPUT_UINPUT
tristate User level driver support
help
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 38efb2c..4da7c3a 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_INPUT_SGI_BTNS)  += sgi_btns.o
 obj-$(CONFIG_INPUT_SPARCSPKR)  += sparcspkr.o
 obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)  += twl4030-pwrbutton.o
 obj-$(CONFIG_INPUT_TWL4030_VIBRA)  += twl4030-vibra.o
+obj-$(CONFIG_INPUT_TWL6040_VIBRA)  += twl6040-vibra.o
 obj-$(CONFIG_INPUT_UINPUT) += uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)   += wistron_btns.o
 obj-$(CONFIG_INPUT_WM831X_ON)  += wm831x-on.o
diff --git a/drivers/input/misc/twl6040-vibra.c 
b/drivers/input/misc/twl6040-vibra.c
new file mode 100644
index 000..acc8348
--- /dev/null
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -0,0 +1,425 @@
+/*
+ * twl6040-vibra.c - TWL6040 Vibrator driver
+ *
+ * Author:  Jorge Eduardo Candelaria jorge.candela...@ti.com
+ * Author:  Misael Lopez Cruz misael.lo...@ti.com
+ *
+ * Copyright:   (C) 2011 Texas Instruments, Inc.
+ *
+ * Based on twl4030-vibra.c by Henrik Saari henrik.sa...@nokia.com
+ * Felipe Balbi felipe.ba...@nokia.com
+ * Jari Vanhala ext-javi.vanh...@nokia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/workqueue.h
+#include linux/i2c/twl.h
+#include linux/mfd/twl6040.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/regulator/consumer.h
+
+#define EFFECT_DIR_180_DEG 0x8000
+
+/* Recommended modulation index 85% */
+#define TWL6040_VIBRA_MOD  85
+
+#define TWL6040_NUM_SUPPLIES 2
+
+struct vibra_info {
+   struct device *dev;
+   struct input_dev *input_dev;
+   struct workqueue_struct *workqueue;
+   struct work_struct play_work;
+   struct mutex mutex;
+
+   bool enabled;
+   int weak_speed;
+   int strong_speed;
+   int direction;
+
+   unsigned int vibldrv_res;
+   unsigned int vibrdrv_res;
+   unsigned int viblmotor_res;
+   unsigned int vibrmotor_res;
+
+   struct regulator_bulk_data supplies[TWL6040_NUM_SUPPLIES];
+
+   struct twl6040 *twl6040;
+};
+
+static irqreturn_t twl6040_vib_irq_handler(int irq, void *data)
+{
+   struct vibra_info *info = data;
+   struct twl6040 *twl6040 = info-twl6040;
+   u8 status;
+
+   status = twl6040_reg_read(twl6040, TWL6040_REG_STATUS);
+   if (status  TWL6040_VIBLOCDET) {
+   dev_warn(info-dev, Left Vibrator overcurrent detected\n);
+   twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLL,
+  TWL6040_VIBENAL);
+   }
+   if (status  TWL6040_VIBROCDET) {
+   dev_warn(info-dev, Right Vibrator overcurrent detected\n);
+   twl6040_clear_bits(twl6040, TWL6040_REG_VIBCTLR,
+  TWL6040_VIBENAR);
+   }
+
+ 

[PATCH v5 12/18] OMAP4: SDP4430: Add twl6040 vibrator platform support

2011-06-13 Thread Peter Ujfalusi
Add twl4030_vibra platform data, and the needed regulators
for twl6040 vibrator.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   48 +++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 968029a..266d146 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -22,6 +22,7 @@
 #include linux/i2c/twl.h
 #include linux/gpio_keys.h
 #include linux/regulator/machine.h
+#include linux/regulator/fixed.h
 #include linux/leds.h
 #include linux/leds_pwm.h
 
@@ -276,11 +277,40 @@ static struct platform_device sdp4430_lcd_device = {
.id = -1,
 };
 
+static struct regulator_consumer_supply sdp4430_vbat_supply[] = {
+   REGULATOR_SUPPLY(vddvibl, twl6040-vibra),
+   REGULATOR_SUPPLY(vddvibr, twl6040-vibra),
+};
+
+static struct regulator_init_data sdp4430_vbat_data = {
+   .constraints = {
+   .always_on  = 1,
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(sdp4430_vbat_supply),
+   .consumer_supplies  = sdp4430_vbat_supply,
+};
+
+static struct fixed_voltage_config sdp4430_vbat_pdata = {
+   .supply_name= VBAT,
+   .microvolts = 375,
+   .init_data  = sdp4430_vbat_data,
+   .gpio   = -EINVAL,
+};
+
+static struct platform_device sdp4430_vbat = {
+   .name   = reg-fixed-voltage,
+   .id = -1,
+   .dev = {
+   .platform_data = sdp4430_vbat_pdata,
+   },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
sdp4430_lcd_device,
sdp4430_gpio_keys_device,
sdp4430_leds_gpio,
sdp4430_leds_pwm,
+   sdp4430_vbat,
 };
 
 static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@ -402,7 +432,25 @@ static struct regulator_init_data sdp4430_vusim = {
},
 };
 
+static struct twl4030_vibra_data twl6040_vibra = {
+   .vibldrv_res = 8,
+   .vibrdrv_res = 3,
+   .viblmotor_res = 10,
+   .vibrmotor_res = 10,
+   .vddvibl_uV = 0,/* fixed volt supply - VBAT */
+   .vddvibr_uV = 0,/* fixed volt supply - VBAT */
+};
+
+static struct twl4030_audio_data twl6040_audio = {
+   .codec  = NULL,
+   .vibra  = twl6040_vibra,
+   .audpwron_gpio  = 127,
+   .naudint_irq= OMAP44XX_IRQ_SYS_2N,
+   .irq_base   = TWL6040_CODEC_IRQ_BASE,
+};
+
 static struct twl4030_platform_data sdp4430_twldata = {
+   .audio  = twl6040_audio,
/* Regulators */
.vusim  = sdp4430_vusim,
.vaux1  = sdp4430_vaux1,
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 14/18] ASoC: twl6040: Support other sample rates in constraints.

2011-06-13 Thread Peter Ujfalusi
From: Liam Girdwood l...@ti.com

Add other supported sample rates to LP and HP modes.

Signed-off-by: Liam Girdwood l...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 28dc5d9..7845cdb 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1203,6 +1203,13 @@ static int twl6040_set_bias_level(struct snd_soc_codec 
*codec,
 /* set of rates for each pll: low-power and high-performance */
 
 static unsigned int lp_rates[] = {
+   8000,
+   11250,
+   16000,
+   22500,
+   32000,
+   44100,
+   48000,
88200,
96000,
 };
@@ -1213,6 +1220,10 @@ static struct snd_pcm_hw_constraint_list lp_constraints 
= {
 };
 
 static unsigned int hp_rates[] = {
+   8000,
+   16000,
+   32000,
+   48000,
96000,
 };
 
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 18/18] OMAP4: SDP4430: Add twl6040 codec platform support

2011-06-13 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

Configure, and enable the twl6040 codec on SDP4430.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/mach-omap2/board-4430sdp.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c 
b/arch/arm/mach-omap2/board-4430sdp.c
index 266d146..369250b 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -432,6 +432,14 @@ static struct regulator_init_data sdp4430_vusim = {
},
 };
 
+static struct twl4030_codec_data twl6040_codec = {
+   /* single-step ramp for headset and handsfree */
+   .hs_left_step   = 0x0f,
+   .hs_right_step  = 0x0f,
+   .hf_left_step   = 0x1d,
+   .hf_right_step  = 0x1d,
+};
+
 static struct twl4030_vibra_data twl6040_vibra = {
.vibldrv_res = 8,
.vibrdrv_res = 3,
@@ -442,7 +450,7 @@ static struct twl4030_vibra_data twl6040_vibra = {
 };
 
 static struct twl4030_audio_data twl6040_audio = {
-   .codec  = NULL,
+   .codec  = twl6040_codec,
.vibra  = twl6040_vibra,
.audpwron_gpio  = 127,
.naudint_irq= OMAP44XX_IRQ_SYS_2N,
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 16/18] ASoC: twl6040: set default constraints.

2011-06-13 Thread Peter Ujfalusi
From: Liam Girdwood l...@ti.com

Set default sysclk constraints to high performance mode.

Signed-off-by: Liam Girdwood l...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index d334d86..3c0d8da 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1507,6 +1507,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
 
/* default is high-performance mode */
priv-headset_mode = 1;
+   priv-sysclk_constraints = hp_constraints;
 
priv-workqueue = create_singlethread_workqueue(twl6040-codec);
if (!priv-workqueue) {
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 13/18] ASoC: twl6040: add all ABE DAIs

2011-06-13 Thread Peter Ujfalusi
From: Liam Girdwood l...@ti.com

Add all DAIs to fully support OMAP4 ABE.

Signed-off-by: Liam Girdwood l...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 sound/soc/codecs/twl6040.c |   44 
 1 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index a20e293..28dc5d9 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1359,23 +1359,51 @@ static struct snd_soc_dai_ops twl6040_dai_ops = {
.set_sysclk = twl6040_set_dai_sysclk,
 };
 
-static struct snd_soc_dai_driver twl6040_dai = {
-   .name = twl6040-hifi,
+static struct snd_soc_dai_driver twl6040_dai[] = {
+{
+   .name = twl6040-ul,
+   .capture = {
+   .stream_name = Capture,
+   .channels_min = 1,
+   .channels_max = 2,
+   .rates = TWL6040_RATES,
+   .formats = TWL6040_FORMATS,
+   },
+   .ops = twl6040_dai_ops,
+},
+{
+   .name = twl6040-dl1,
.playback = {
-   .stream_name = Playback,
+   .stream_name = Headset Playback,
.channels_min = 1,
-   .channels_max = 4,
+   .channels_max = 2,
.rates = TWL6040_RATES,
.formats = TWL6040_FORMATS,
},
-   .capture = {
-   .stream_name = Capture,
+   .ops = twl6040_dai_ops,
+},
+{
+   .name = twl6040-dl2,
+   .playback = {
+   .stream_name = Handsfree Playback,
.channels_min = 1,
.channels_max = 2,
.rates = TWL6040_RATES,
.formats = TWL6040_FORMATS,
},
.ops = twl6040_dai_ops,
+},
+{
+   .name = twl6040-vib,
+   .playback = {
+   .stream_name = Vibra Playback,
+   .channels_min = 2,
+   .channels_max = 2,
+   .rates = SNDRV_PCM_RATE_CONTINUOUS,
+   .formats = TWL6040_FORMATS,
+   },
+   .ops = twl6040_dai_ops,
+},
 };
 
 #ifdef CONFIG_PM
@@ -1502,8 +1530,8 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 
= {
 
 static int __devinit twl6040_codec_probe(struct platform_device *pdev)
 {
-   return snd_soc_register_codec(pdev-dev,
-   soc_codec_dev_twl6040, twl6040_dai, 1);
+   return snd_soc_register_codec(pdev-dev, soc_codec_dev_twl6040,
+ twl6040_dai, ARRAY_SIZE(twl6040_dai));
 }
 
 static int __devexit twl6040_codec_remove(struct platform_device *pdev)
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] OMAP3 IOMMU fixes

2011-06-13 Thread Laurent Pinchart
Hi Tony,

On Monday 13 June 2011 15:40:34 Tony Lindgren wrote:
 * Laurent Pinchart laurent.pinch...@ideasonboard.com [110608 03:43]:
  Hi Tony,
  
  On Monday 30 May 2011 14:47:07 Laurent Pinchart wrote:
   Hi everybody,
   
   Here are two OMAP3 IOMMU fixes required to support big and/or unaligned
   memory buffers.
   
   Laurent Pinchart (2):
 omap3: iovmm: Work around sg_alloc_table size limitation in IOMMU
 omap3: iovmm: Support non page-aligned buffers in iommu_vmap
  
  As per Russell comments, the first patch needs more work (or at least
  more discussions). Could you apply the second patch already ?
 
 It's getting too late for this cycle as this can be counted as
 features that never worked type of patch. If it's a regression,
 then please specify the commit breaking this suport.
 
 So let's plan on doing the move to drivers and patching whatever is
 needed for the upcoming merge window.

OK. Ohad, could you please apply this patch to your tree and submit it with 
the whole series for 3.1 ?

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 10/18] MFD: twl6040: Change platform data for soc codec driver

2011-06-13 Thread Peter Ujfalusi
Pass twl4030_codec_data instead of the twl4030_audio_data
for the ASoC codec driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 drivers/mfd/twl6040-core.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index 195613c..b6e5338 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -507,9 +507,8 @@ static int __devinit twl6040_probe(struct platform_device 
*pdev)
if (pdata-codec) {
cell = twl6040-cells[children];
cell-name = twl6040-codec;
-   /* The codec expects the twl4030_audio_data as platform data */
-   cell-platform_data = pdata;
-   cell-pdata_size = sizeof(*pdata);
+   cell-platform_data = pdata-codec;
+   cell-pdata_size = sizeof(*pdata-codec);
children++;
}
 
-- 
1.7.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v5 08/18] mfd: twl6040: Add initial support

2011-06-13 Thread Peter Ujfalusi
From: Misael Lopez Cruz misael.lo...@ti.com

TWL6040 IC provides analog high-end audio codec functions for
handset applications. It contains several audio analog inputs
and outputs as well as vibrator support. It's connected to the
host processor via PDM interface for audio data communication.
The audio modules are controlled by internal registers that
can be accessed by I2C and PDM interface.

TWL6040 MFD will be registered as a child of TWL-CORE, and will
have two children of its own: twl6040-codec and twl6040-vibra.

This driver is based on TWL4030 and WM8350 MFD drivers.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 arch/arm/plat-omap/include/plat/irqs.h |   12 +-
 drivers/mfd/Kconfig|6 +
 drivers/mfd/Makefile   |1 +
 drivers/mfd/twl-core.c |5 +-
 drivers/mfd/twl6040-core.c |  602 
 drivers/mfd/twl6040-irq.c  |  205 +++
 include/linux/i2c/twl.h|1 +
 include/linux/mfd/twl6040.h|  261 ++
 8 files changed, 1088 insertions(+), 5 deletions(-)
 create mode 100644 drivers/mfd/twl6040-core.c
 create mode 100644 drivers/mfd/twl6040-irq.c
 create mode 100644 include/linux/mfd/twl6040.h

diff --git a/arch/arm/plat-omap/include/plat/irqs.h 
b/arch/arm/plat-omap/include/plat/irqs.h
index 5a25098..2cfba51 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -407,11 +407,19 @@
 #endif
 #define TWL6030_IRQ_END(TWL6030_IRQ_BASE + 
TWL6030_BASE_NR_IRQS)
 
+#define TWL6040_CODEC_IRQ_BASE TWL6030_IRQ_END
+#ifdef CONFIG_TWL6040_CODEC
+#define TWL6040_CODEC_NR_IRQS  6
+#else
+#define TWL6040_CODEC_NR_IRQS  0
+#endif
+#define TWL6040_CODEC_IRQ_END  (TWL6040_CODEC_IRQ_BASE + TWL6040_CODEC_NR_IRQS)
+
 /* Total number of interrupts depends on the enabled blocks above */
-#if (TWL4030_GPIO_IRQ_END  TWL6030_IRQ_END)
+#if (TWL4030_GPIO_IRQ_END  TWL6040_CODEC_IRQ_END)
 #define TWL_IRQ_ENDTWL4030_GPIO_IRQ_END
 #else
-#define TWL_IRQ_ENDTWL6030_IRQ_END
+#define TWL_IRQ_ENDTWL6040_CODEC_IRQ_END
 #endif
 
 /* GPMC related */
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3a6f76a..ac6b4ae 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -233,6 +233,12 @@ config TWL6030_PWM
  Say yes here if you want support for TWL6030 PWM.
  This is used to control charging LED brightness.
 
+config TWL6040_CORE
+   bool
+   depends on TWL4030_CORE  GENERIC_HARDIRQS
+   select MFD_CORE
+   default n
+
 config MFD_STMPE
bool Support STMicroelectronics STMPE
depends on I2C=y  GENERIC_HARDIRQS
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4cf9465..41f3b61 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_TWL4030_MADC)  += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
 obj-$(CONFIG_MFD_TWL4030_AUDIO)+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)  += twl6030-pwm.o
+obj-$(CONFIG_TWL6040_CORE) += twl6040-core.o twl6040-irq.o
 
 obj-$(CONFIG_MFD_MC13XXX)  += mc13xxx-core.o
 
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index f9d7880..a2eddc7 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -110,7 +110,7 @@
 #endif
 
 #if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE) ||\
-   defined(CONFIG_SND_SOC_TWL6040) || 
defined(CONFIG_SND_SOC_TWL6040_MODULE)
+   defined(CONFIG_TWL6040_CORE) || defined(CONFIG_TWL6040_CORE_MODULE)
 #define twl_has_codec()true
 #else
 #define twl_has_codec()false
@@ -824,10 +824,9 @@ add_children(struct twl4030_platform_data *pdata, unsigned 
long features)
return PTR_ERR(child);
}
 
-   /* Phoenix codec driver is probed directly atm */
if (twl_has_codec()  pdata-audio  twl_class_is_6030()) {
sub_chip_id = twl_map[TWL_MODULE_AUDIO_VOICE].sid;
-   child = add_child(sub_chip_id, twl6040-codec,
+   child = add_child(sub_chip_id, twl6040,
pdata-audio, sizeof(*pdata-audio),
false, 0, 0);
if (IS_ERR(child))
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
new file mode 100644
index 000..195613c
--- /dev/null
+++ b/drivers/mfd/twl6040-core.c
@@ -0,0 +1,602 @@
+/*
+ * MFD driver for TWL6040 audio device
+ *
+ * Authors:Misael Lopez Cruz misael.lo...@ti.com
+ * Jorge Eduardo Candelaria jorge.candela...@ti.com
+ * Peter Ujfalusi peter.ujfal...@ti.com
+ *
+ * Copyright:  (C) 2011 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * 

[PATCH v5 06/18] MFD: twl4030-codec - twl4030-audio: Rename the driver

2011-06-13 Thread Peter Ujfalusi
Rename the driver, and header file from twl4030-codec to
twl4030-audio.
To avoid breakage change depending drivers at the same time.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Misael Lopez Cruz misael.lo...@ti.com
---
 drivers/input/misc/Kconfig |2 +-
 drivers/input/misc/twl4030-vibra.c |   10 +++---
 drivers/mfd/Kconfig|2 +-
 drivers/mfd/Makefile   |2 +-
 drivers/mfd/{twl4030-codec.c = twl4030-audio.c}   |   33 +--
 .../linux/mfd/{twl4030-codec.h = twl4030-audio.h} |   16 +-
 sound/soc/codecs/Kconfig   |2 +-
 sound/soc/codecs/twl4030.c |   16 +-
 sound/soc/omap/sdp3430.c   |2 +-
 sound/soc/omap/zoom2.c |2 +-
 10 files changed, 43 insertions(+), 44 deletions(-)
 rename drivers/mfd/{twl4030-codec.c = twl4030-audio.c} (87%)
 rename include/linux/mfd/{twl4030-codec.h = twl4030-audio.h} (96%)

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 45dc6aa..077309a 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -267,7 +267,7 @@ config INPUT_TWL4030_PWRBUTTON
 config INPUT_TWL4030_VIBRA
tristate Support for TWL4030 Vibrator
depends on TWL4030_CORE
-   select TWL4030_CODEC
+   select MFD_TWL4030_AUDIO
select INPUT_FF_MEMLESS
help
  This option enables support for TWL4030 Vibrator Driver.
diff --git a/drivers/input/misc/twl4030-vibra.c 
b/drivers/input/misc/twl4030-vibra.c
index 014dd4a..7abca85 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -28,7 +28,7 @@
 #include linux/platform_device.h
 #include linux/workqueue.h
 #include linux/i2c/twl.h
-#include linux/mfd/twl4030-codec.h
+#include linux/mfd/twl4030-audio.h
 #include linux/input.h
 #include linux/slab.h
 
@@ -67,7 +67,7 @@ static void vibra_enable(struct vibra_info *info)
 {
u8 reg;
 
-   twl4030_codec_enable_resource(TWL4030_CODEC_RES_POWER);
+   twl4030_audio_enable_resource(TWL4030_AUDIO_RES_POWER);
 
/* turn H-Bridge on */
twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE,
@@ -75,7 +75,7 @@ static void vibra_enable(struct vibra_info *info)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
 (reg | TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
 
-   twl4030_codec_enable_resource(TWL4030_CODEC_RES_APLL);
+   twl4030_audio_enable_resource(TWL4030_AUDIO_RES_APLL);
 
info-enabled = true;
 }
@@ -90,8 +90,8 @@ static void vibra_disable(struct vibra_info *info)
twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
 (reg  ~TWL4030_VIBRA_EN), TWL4030_REG_VIBRA_CTL);
 
-   twl4030_codec_disable_resource(TWL4030_CODEC_RES_APLL);
-   twl4030_codec_disable_resource(TWL4030_CODEC_RES_POWER);
+   twl4030_audio_disable_resource(TWL4030_AUDIO_RES_APLL);
+   twl4030_audio_disable_resource(TWL4030_AUDIO_RES_POWER);
 
info-enabled = false;
 }
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0f09c05..3a6f76a 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -218,7 +218,7 @@ config TWL4030_POWER
  and load scripts controlling which resources are switched off/on
  or reset when a sleep, wakeup or warm reset event occurs.
 
-config TWL4030_CODEC
+config MFD_TWL4030_AUDIO
bool
depends on TWL4030_CORE
select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index efe3cc3..4cf9465 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_MENELAUS)+= menelaus.o
 obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
 obj-$(CONFIG_TWL4030_MADC)  += twl4030-madc.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
-obj-$(CONFIG_TWL4030_CODEC)+= twl4030-codec.o
+obj-$(CONFIG_MFD_TWL4030_AUDIO)+= twl4030-audio.o
 obj-$(CONFIG_TWL6030_PWM)  += twl6030-pwm.o
 
 obj-$(CONFIG_MFD_MC13XXX)  += mc13xxx-core.o
diff --git a/drivers/mfd/twl4030-codec.c b/drivers/mfd/twl4030-audio.c
similarity index 87%
rename from drivers/mfd/twl4030-codec.c
rename to drivers/mfd/twl4030-audio.c
index e1782b3..5cdf841 100644
--- a/drivers/mfd/twl4030-codec.c
+++ b/drivers/mfd/twl4030-audio.c
@@ -30,7 +30,7 @@
 #include linux/platform_device.h
 #include linux/i2c/twl.h
 #include linux/mfd/core.h
-#include linux/mfd/twl4030-codec.h
+#include linux/mfd/twl4030-audio.h
 
 #define TWL4030_AUDIO_CELLS2
 
@@ -45,7 +45,7 @@ struct twl4030_audio_resource {
 struct twl4030_audio {
unsigned int audio_mclk;
struct mutex mutex;
-   struct twl4030_audio_resource resource[TWL4030_CODEC_RES_MAX];
+   struct twl4030_audio_resource resource[TWL4030_AUDIO_RES_MAX];
struct mfd_cell cells[TWL4030_AUDIO_CELLS];
 };
 

Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value to int

2011-06-13 Thread Tomi Valkeinen
On Mon, 2011-06-13 at 11:37 -0500, Ghongdemath, Girish wrote:
 Tomi,
 Couple of queries,
 
 On Mon, Jun 13, 2011 at 4:51 AM, Tomi Valkeinen tomi.valkei...@ti.com wrote:
  Paul, can you take this patch and queue it for an rc?
 
   Tomi
 
  On Thu, 2011-06-09 at 16:56 +0300, Tomi Valkeinen wrote:
  get_context_loss_count functions return context loss count as u32, and
  zero means an error. However, zero is also returned when context has
  never been lost and could also be returned when the context loss count
  has wrapped and goes to zero.
 
  Change the functions to return an int, with negative value meaning an
  error.
 
 
  + if (off_mode_enabled) {
 
 - why have a check for off_mode_enabled? As this only detects valid
 next state for MPU/CORE. Other pwrdm can still
 hit OFF.

It does what the code did previously, without changing the logic. And
this doesn't detect anything, it's just an dummy emulation for context
loss to test the drivers.

  + count++;
  + /*
  +  * Context loss count has to be a non-negative value.
  +  * Clear the sign bit to get a value range from 0 to
  +  * INT_MAX.
  +  */
  + count = INT_MAX;
  + dummy_context_loss_counter = count;
  + }
}
 
 - Why not use u32 instead?

So that we can return error values. That was the whole point of this
patch.

 Tomi


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Tanya Brokhman
 
 The change I suggested involved replacing two typecasts with a single
 min_t.  All (or almost all) the places this patch touches currently
 contain only one typecast, so the motivation for changing them is a lot
 weaker.
 
You're right. So what's the final call on this one? Do you think it can be
merged or you prefer not change anything? I personally think the code looks
nicer using min_t instead of min with casting but that's just my opinion and
of course there are arguments against this patch.


Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.





--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/4] msm: iommu: move to drivers/iommu/

2011-06-13 Thread David Brown
On Fri, Jun 10 2011, Ohad Ben-Cohen wrote:

 This should ease finding similarities with different platforms,
 with the intention of solving problems once in a generic framework
 which everyone can use.

 Compile-tested for MSM8X60.

Acked-by: David Brown dav...@codeaurora.org

I believe that Stepan Moskovochenko has some extra tests for this code,
but given that none of the code itself changes, I wouldn't expect any
problems.

David

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Alan Stern
On Mon, 13 Jun 2011, Tanya Brokhman wrote:

  
  The change I suggested involved replacing two typecasts with a single
  min_t.  All (or almost all) the places this patch touches currently
  contain only one typecast, so the motivation for changing them is a lot
  weaker.
  
 You're right. So what's the final call on this one? Do you think it can be
 merged or you prefer not change anything? I personally think the code looks
 nicer using min_t instead of min with casting but that's just my opinion and
 of course there are arguments against this patch.

I don't care either way.  It's up to you and Felipe.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb:gadget: use min_t() macro instead of min()

2011-06-13 Thread Felipe Balbi
Hi,

On Mon, Jun 13, 2011 at 03:03:44PM -0400, Alan Stern wrote:
   The change I suggested involved replacing two typecasts with a single
   min_t.  All (or almost all) the places this patch touches currently
   contain only one typecast, so the motivation for changing them is a lot
   weaker.
   
  You're right. So what's the final call on this one? Do you think it can be
  merged or you prefer not change anything? I personally think the code looks
  nicer using min_t instead of min with casting but that's just my opinion and
  of course there are arguments against this patch.
 
 I don't care either way.  It's up to you and Felipe.

I guess it's better to have a more critical look at the arguments first.
Looking into dummy_hcd for instance, it doesn't appear like we need to
be int, it could be unsigned int. I just skimmed through the code, but
it looks like we will always hold = 0 values on that variable.

So go through that exercise first, then we look at the others. Blindly
changing to min_t() might not give us any improvements at all ;-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 0/2] OMAP3 IOMMU fixes

2011-06-13 Thread Ohad Ben-Cohen
On Mon, Jun 13, 2011 at 7:41 PM, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
   Laurent Pinchart (2):
...
     omap3: iovmm: Support non page-aligned buffers in iommu_vmap
...
 OK. Ohad, could you please apply this patch to your tree and submit it with
 the whole series for 3.1 ?

Sure I can. I'll make sure it goes in once we reach drivers/.

Thanks,
Ohad.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] arm: omap3: cm-t35: add support for cm-t3730

2011-06-13 Thread Igor Grinberg
On 06/13/11 16:33, Tony Lindgren wrote:
 * Igor Grinberg grinb...@compulab.co.il [110603 06:33]:
 I'm not sure I understand what are you trying to propose here...
 If you look once again on the code, there is currently only one if 
 (cpu_is_..) {} else {}
 statement currently present.
 (I can remove the if (cpu_is_omap3630()) - it indeed has no value)

 Indeed, there will be some other differences...
 Each time I submit a patch, I try to be as optimal as I can,
 but again I'm open for suggestions...
 (though I think it is optimal, e.g. 33 lines for a new running board...)
 What I meant is that maybe you should do the detection first in some
 get_revision function and populate the gpio pins there. Sort of like
 this recent beagle patch:

 https://patchwork.kernel.org/patch/859662/

Yes I've seen this patch (actually, I was one of the people who reviewed it).

 That way adding support for other differences will be easier.

OK, now I understand what you mean.
I think currently this is not optimal for cm-t35/3730 and will just complicate
things and introduce more l-o-c.

The situation on beagle board is much more complicated then on cm-t3x.
Beagle has quite a large number of revisions,
while cm-t35 has only one and cm-t3730 has only one.
Moreover, there is no difference in gpios - same numbers are used
for the same functionality.

In particular the only two differences (that s/w cares about) between the 
boards are:
1) mux of the DSS pins
2) no NAND on cm-t3730 (still not introduced by the patch in subj)

Nevertheless, I will try to come up with something,
so we can see and decide what is a better option.

I will base it on your devel-board branch
(correct me if you want it some other way).


-- 
Regards,
Igor.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] CBUS Patches

2011-06-13 Thread Felipe Balbi
Hi Tony,

the following two patches get rid of
the static global variable holding the
bus context. It's not needed at all.

This will allow us to have multiple
CBUS buses by using different GPIOs.

Will never be useful, but that's it
should've been done anyway :-p

Felipe Balbi (2):
  cbus: make cbus parent of bus users
  cbus: pass device as argument

 arch/arm/mach-omap1/board-nokia770.c |4 
 arch/arm/mach-omap2/board-n8x0.c |4 
 drivers/cbus/cbus.c  |   20 +++-
 drivers/cbus/cbus.h  |5 +++--
 drivers/cbus/retu.c  |4 ++--
 drivers/cbus/tahvo.c |9 +++--
 6 files changed, 31 insertions(+), 15 deletions(-)

-- 
1.7.6.rc1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] cbus: make cbus parent of bus users

2011-06-13 Thread Felipe Balbi
CBUS is the underlying bus device, make
it the parent of the bus users (retu and
tahvo).

Signed-off-by: Felipe Balbi ba...@ti.com
---
 arch/arm/mach-omap1/board-nokia770.c |4 
 arch/arm/mach-omap2/board-n8x0.c |4 
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c 
b/arch/arm/mach-omap1/board-nokia770.c
index 5d174a3..676d99f 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -136,6 +136,7 @@ static struct platform_device retu_device = {
.num_resources  = ARRAY_SIZE(retu_resource),
.dev= {
.platform_data = nokia770_retu_data,
+   .parent = nokia770_cbus_device.dev,
},
 };
 
@@ -151,6 +152,9 @@ static struct platform_device tahvo_device = {
.id = -1,
.resource   = tahvo_resource,
.num_resources  = ARRAY_SIZE(tahvo_resource),
+   .dev= {
+   .parent = nokia770_cbus_device.dev,
+   },
 };
 
 static struct platform_device tahvo_usb_device = {
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index ad06bde..b61ac1d 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -232,6 +232,7 @@ static struct platform_device retu_device = {
.num_resources  = ARRAY_SIZE(retu_resource),
.dev= {
.platform_data = n8x0_retu_data,
+   .parent = n8x0_cbus_device.dev,
},
 };
 
@@ -247,6 +248,9 @@ static struct platform_device tahvo_device = {
.id = -1,
.resource   = tahvo_resource,
.num_resources  = ARRAY_SIZE(tahvo_resource),
+   .dev= {
+   .parent = n8x0_cbus_device.dev,
+   },
 };
 
 static struct platform_device tahvo_usb_device = {
-- 
1.7.6.rc1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] cbus: pass device as argument

2011-06-13 Thread Felipe Balbi
that way we can fetch struct cbus_host
via dev_get_platform_data(child-parent).

This also allows us to remove the static
global variable holding cbus_host pointer.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/cbus/cbus.c  |   20 +++-
 drivers/cbus/cbus.h  |5 +++--
 drivers/cbus/retu.c  |4 ++--
 drivers/cbus/tahvo.c |9 +++--
 4 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/cbus/cbus.c b/drivers/cbus/cbus.c
index a8bbf42..fb524cb 100644
--- a/drivers/cbus/cbus.c
+++ b/drivers/cbus/cbus.c
@@ -52,8 +52,6 @@ struct cbus_host {
int sel_gpio;
 };
 
-static struct cbus_host *cbus_host;
-
 /**
  * cbus_send_bit - sends one bit over the bus
  * @host: the host we're using
@@ -220,24 +218,31 @@ out:
 
 /**
  * cbus_read_reg - reads a given register from the device
+ * @child: the child device
  * @dev: device address
  * @reg: register address
  */
-int cbus_read_reg(unsigned dev, unsigned reg)
+int cbus_read_reg(struct device *child, unsigned dev, unsigned reg)
 {
-   return cbus_transfer(cbus_host, CBUS_XFER_READ, dev, reg, 0);
+   struct cbus_host*host = dev_get_drvdata(child-parent);
+
+   return cbus_transfer(host, CBUS_XFER_READ, dev, reg, 0);
 }
 EXPORT_SYMBOL(cbus_read_reg);
 
 /**
  * cbus_write_reg - writes to a given register of the device
+ * @child: the child device
  * @dev: device address
  * @reg: register address
  * @val: data to be written to @reg
  */
-int cbus_write_reg(unsigned dev, unsigned reg, unsigned val)
+int cbus_write_reg(struct device *child, unsigned dev, unsigned reg,
+   unsigned val)
 {
-   return cbus_transfer(cbus_host, CBUS_XFER_WRITE, dev, reg, val);
+   struct cbus_host*host = dev_get_drvdata(child-parent);
+
+   return cbus_transfer(host, CBUS_XFER_WRITE, dev, reg, val);
 }
 EXPORT_SYMBOL(cbus_write_reg);
 
@@ -279,8 +284,6 @@ static int __init cbus_bus_probe(struct platform_device 
*pdev)
 
platform_set_drvdata(pdev, chost);
 
-   cbus_host = chost;
-
return 0;
 exit3:
gpio_free(chost-dat_gpio);
@@ -301,7 +304,6 @@ static void __exit cbus_bus_remove(struct platform_device 
*pdev)
gpio_free(chost-clk_gpio);
 
kfree(chost);
-   cbus_host = NULL;
 }
 
 static struct platform_driver cbus_driver = {
diff --git a/drivers/cbus/cbus.h b/drivers/cbus/cbus.h
index d53bb70..c1c3bd6 100644
--- a/drivers/cbus/cbus.h
+++ b/drivers/cbus/cbus.h
@@ -23,7 +23,8 @@
 #ifndef __DRIVERS_CBUS_CBUS_H
 #define __DRIVERS_CBUS_CBUS_H
 
-extern int cbus_read_reg(unsigned dev, unsigned reg);
-extern int cbus_write_reg(unsigned dev, unsigned reg, unsigned val);
+extern int cbus_read_reg(struct device *, unsigned dev, unsigned reg);
+extern int cbus_write_reg(struct device *, unsigned dev, unsigned reg,
+   unsigned val);
 
 #endif /* __DRIVERS_CBUS_CBUS_H */
diff --git a/drivers/cbus/retu.c b/drivers/cbus/retu.c
index ec108f3..4b5af58 100644
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -79,7 +79,7 @@ static struct retu *the_retu;
  */
 static int __retu_read_reg(struct retu *retu, unsigned reg)
 {
-   return cbus_read_reg(retu-devid, reg);
+   return cbus_read_reg(retu-dev, retu-devid, reg);
 }
 
 /**
@@ -90,7 +90,7 @@ static int __retu_read_reg(struct retu *retu, unsigned reg)
  */
 static void __retu_write_reg(struct retu *retu, unsigned reg, u16 val)
 {
-   cbus_write_reg(retu-devid, reg, val);
+   cbus_write_reg(retu-dev, retu-devid, reg, val);
 }
 
 /**
diff --git a/drivers/cbus/tahvo.c b/drivers/cbus/tahvo.c
index 45318d9..bc440bc 100644
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -55,6 +55,8 @@ static int tahvo_is_betty;
 static struct tasklet_struct tahvo_tasklet;
 static DEFINE_SPINLOCK(tahvo_lock);
 
+static struct device *the_dev;
+
 struct tahvo_irq_handler_desc {
int (*func)(unsigned long);
unsigned long arg;
@@ -78,7 +80,7 @@ EXPORT_SYMBOL(tahvo_get_status);
 int tahvo_read_reg(unsigned reg)
 {
BUG_ON(!tahvo_initialized);
-   return cbus_read_reg(TAHVO_ID, reg);
+   return cbus_read_reg(the_dev, TAHVO_ID, reg);
 }
 EXPORT_SYMBOL(tahvo_read_reg);
 
@@ -92,7 +94,7 @@ EXPORT_SYMBOL(tahvo_read_reg);
 void tahvo_write_reg(unsigned reg, u16 val)
 {
BUG_ON(!tahvo_initialized);
-   cbus_write_reg(TAHVO_ID, reg, val);
+   cbus_write_reg(the_dev, TAHVO_ID, reg, val);
 }
 EXPORT_SYMBOL(tahvo_write_reg);
 
@@ -305,6 +307,8 @@ static int __init tahvo_probe(struct platform_device *pdev)
int rev, id, ret;
int irq;
 
+   the_dev = pdev-dev;
+
/* Prepare tasklet */
tasklet_init(tahvo_tasklet, tahvo_tasklet_handler, 0);
 
@@ -351,6 +355,7 @@ static int __exit tahvo_remove(struct platform_device *pdev)
tahvo_write_reg(TAHVO_REG_IMR, 0x);
free_irq(irq, 0);
tasklet_kill(tahvo_tasklet);
+   the_dev = NULL;
 
return 0;
 }
-- 
1.7.6.rc1

--
To unsubscribe 

Re: [RFC PATCHv5 2/7] HSI: omap_ssi: Introducing OMAP SSI driver

2011-06-13 Thread Kevin Hilman
Carlos Chinea carlos.chi...@nokia.com writes:

 Introduces the OMAP SSI driver in the kernel.

 The Synchronous Serial Interface (SSI) is a legacy version
 of HSI. As in the case of HSI, it is mainly used to connect
 Application engines (APE) with cellular modem engines (CMT)
 in cellular handsets.

 It provides a multichannel, full-duplex, multi-core communication
 with no reference clock. The OMAP SSI block is capable of reaching
 speeds of 110 Mbit/s.

 Signed-off-by: Carlos Chinea carlos.chi...@nokia.com
 ---
  arch/arm/mach-omap2/ssi.c |  134 +++
  arch/arm/plat-omap/include/plat/ssi.h |  204 
  drivers/hsi/controllers/omap_ssi.c| 1852 
 +
  3 files changed, 2190 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-omap2/ssi.c
  create mode 100644 arch/arm/plat-omap/include/plat/ssi.h
  create mode 100644 drivers/hsi/controllers/omap_ssi.c

 diff --git a/arch/arm/mach-omap2/ssi.c b/arch/arm/mach-omap2/ssi.c
 new file mode 100644
 index 000..e822a77
 --- /dev/null
 +++ b/arch/arm/mach-omap2/ssi.c
 @@ -0,0 +1,134 @@
 +/*
 + * linux/arch/arm/mach-omap2/ssi.c

Minor: Please don't include filenames in the comments.  Files tend to move
around and these comments don't get updated.

 + * Copyright (C) 2010 Nokia Corporation. All rights reserved.
 + *
 + * Contact: Carlos Chinea carlos.chi...@nokia.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * version 2 as published by the Free Software Foundation.
 + *
 + * 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., 51 Franklin St, Fifth Floor, Boston, MA
 + * 02110-1301 USA
 + */
 +
 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/err.h
 +#include linux/gpio.h
 +#include linux/platform_device.h
 +#include plat/omap-pm.h
 +#include plat/ssi.h
 +
 +static struct omap_ssi_platform_data ssi_pdata = {
 + .num_ports  = SSI_NUM_PORTS,
 + .get_dev_context_loss_count = omap_pm_get_dev_context_loss_count,
 +};
 +
 +static struct resource ssi_resources[] = {
 + /* SSI controller */
 + [0] = {
 + .start  = 0x48058000,
 + .end= 0x48058fff,
 + .name   = omap_ssi_sys,
 + .flags  = IORESOURCE_MEM,
 + },
 + /* GDD */
 + [1] = {
 + .start  = 0x48059000,
 + .end= 0x48059fff,
 + .name   = omap_ssi_gdd,
 + .flags  = IORESOURCE_MEM,
 + },
 + [2] = {
 + .start  = 71,
 + .end= 71,
 + .name   = ssi_gdd,
 + .flags  = IORESOURCE_IRQ,
 + },
 + /* SSI port 1 */
 + [3] = {
 + .start  = 0x4805a000,
 + .end= 0x4805a7ff,
 + .name   = omap_ssi_sst1,
 + .flags  = IORESOURCE_MEM,
 + },
 + [4] = {
 + .start  = 0x4805a800,
 + .end= 0x4805afff,
 + .name   = omap_ssi_ssr1,
 + .flags  = IORESOURCE_MEM,
 + },
 + [5] = {
 + .start  = 67,
 + .end= 67,
 + .name   = ssi_p1_mpu_irq0,
 + .flags  = IORESOURCE_IRQ,
 + },
 + [6] = {
 + .start  = 68,
 + .end= 68,
 + .name   = ssi_p1_mpu_irq1,
 + .flags  = IORESOURCE_IRQ,
 + },
 + [7] = {
 + .start  = 0,
 + .end= 0,
 + .name   = ssi_p1_cawake,
 + .flags  = IORESOURCE_IRQ | IORESOURCE_UNSET,
 + },
 +};
 +
 +static struct platform_device ssi_pdev = {
 + .name   = omap_ssi,
 + .id = 0,
 + .num_resources  = ARRAY_SIZE(ssi_resources),
 + .resource   = ssi_resources,
 + .dev= {
 + .platform_data  = ssi_pdata,
 + },
 +};

omap_hwmod has all the base address and IRQ data, will construct the
struct resources and the platform_devices for you.  Please use
omap_hwmod + omap_device for this part of the code.

Kevin


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] input: keypad: lm8323: convert to threaded IRQ

2011-06-13 Thread Felipe Balbi
there's no need for that workqueue anymore.
Get rid of it and move to threaded IRQs
instead.

Signed-off-by: Felipe Balbi ba...@ti.com
---

compile tested only. I need someone to reply with
a Tested-by tag.

 drivers/input/keyboard/lm8323.c |   23 ---
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
index 71f744a8..3b21f42 100644
--- a/drivers/input/keyboard/lm8323.c
+++ b/drivers/input/keyboard/lm8323.c
@@ -146,7 +146,6 @@ struct lm8323_chip {
/* device lock */
struct mutexlock;
struct i2c_client   *client;
-   struct work_struct  work;
struct input_dev*idev;
boolkp_enabled;
boolpm_suspend;
@@ -162,7 +161,6 @@ struct lm8323_chip {
 
 #define client_to_lm8323(c)container_of(c, struct lm8323_chip, client)
 #define dev_to_lm8323(d)   container_of(d, struct lm8323_chip, client-dev)
-#define work_to_lm8323(w)  container_of(w, struct lm8323_chip, work)
 #define cdev_to_pwm(c) container_of(c, struct lm8323_pwm, cdev)
 #define work_to_pwm(w) container_of(w, struct lm8323_pwm, work)
 
@@ -375,9 +373,9 @@ static void pwm_done(struct lm8323_pwm *pwm)
  * Bottom half: handle the interrupt by posting key events, or dealing with
  * errors appropriately.
  */
-static void lm8323_work(struct work_struct *work)
+static irqreturn_t lm8323_irq(int irq, void *_lm)
 {
-   struct lm8323_chip *lm = work_to_lm8323(work);
+   struct lm8323_chip *lm = _lm;
u8 ints;
int i;
 
@@ -409,16 +407,6 @@ static void lm8323_work(struct work_struct *work)
}
 
mutex_unlock(lm-lock);
-}
-
-/*
- * We cannot use I2C in interrupt context, so we just schedule work.
- */
-static irqreturn_t lm8323_irq(int irq, void *data)
-{
-   struct lm8323_chip *lm = data;
-
-   schedule_work(lm-work);
 
return IRQ_HANDLED;
 }
@@ -675,7 +663,6 @@ static int __devinit lm8323_probe(struct i2c_client *client,
lm-client = client;
lm-idev = idev;
mutex_init(lm-lock);
-   INIT_WORK(lm-work, lm8323_work);
 
lm-size_x = pdata-size_x;
lm-size_y = pdata-size_y;
@@ -746,9 +733,8 @@ static int __devinit lm8323_probe(struct i2c_client *client,
goto fail3;
}
 
-   err = request_irq(client-irq, lm8323_irq,
- IRQF_TRIGGER_FALLING | IRQF_DISABLED,
- lm8323, lm);
+   err = request_threaded_irq(client-irq, NULL, lm8323_irq,
+ IRQF_TRIGGER_FALLING, lm8323, lm);
if (err) {
dev_err(client-dev, could not get IRQ %d\n, client-irq);
goto fail4;
@@ -783,7 +769,6 @@ static int __devexit lm8323_remove(struct i2c_client 
*client)
 
disable_irq_wake(client-irq);
free_irq(client-irq, lm);
-   cancel_work_sync(lm-work);
 
input_unregister_device(lm-idev);
 
-- 
1.7.6.rc1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Re: [PATCH v4 11/18] input: Add initial support for TWL6040 vibrator

2011-06-13 Thread Dmitry Torokhov
On Mon, Jun 13, 2011 at 12:51:16PM +0300, Péter Ujfalusi wrote:
 On Sunday 12 June 2011 01:18:54 Dmitry Torokhov wrote:
 
   +static int twl6040_vibra_open(struct input_dev *input)
   +{
   + struct vibra_info *info = input_get_drvdata(input);
   +
   + info-workqueue = create_singlethread_workqueue(vibra);
   + if (info-workqueue == NULL) {
   + dev_err(input-dev, couldn't create workqueue\n);
   + return -ENOMEM;
   + }
  
  Why do we need to create a separate workqueue? With arrival of CWQ
  it looks like we should be able to use one of the system-wide
  workqueues for this.
 
 The reason for this is to ensure that we have the lowest latency as possible 
 in most case. In the embedded devices we use the vibra for tactile type of 
 feedbacks as well, where few tens of ms delay can be felt.

Even if you create a dedicated workqueue with CWQ it will still be using
shared pool of threads so I do not think that latency will be affected
by using system-wide workqueue. I might be mistaken though, Tejun will
correct me if I am wrong...

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Duration of mdelay and udelay depends on MPU frequency in SMP

2011-06-13 Thread Stephen Boyd
On 06/10/2011 03:19 PM, Menon, Nishanth wrote:
 On Thu, May 12, 2011 at 01:42, Santosh Shilimkar
 santosh.shilim...@ti.com wrote:

 It's a well known problem if the udelay() is based of global lpj.
 You can read more here [1]

 Regards
 Santosh
 [1] http://eeek.borgchat.net/lists/arm-kernel/msg120702.html
 I am curious about this topic now.
 Searching Russel's patchworks for this:
 http://www.arm.linux.org.uk/developer/patches/search.php?summary=udelay
 I see nothing queued. What is the recommendation for udelay?

The patches are sitting in Russell's patch tracker, waiting for him to
accept/reject them.

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6874/1
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6875/1
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6873/1

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Duration of mdelay and udelay depends on MPU frequency in SMP

2011-06-13 Thread Menon, Nishanth
On Mon, Jun 13, 2011 at 22:24, Stephen Boyd sb...@codeaurora.org wrote:
 On 06/10/2011 03:19 PM, Menon, Nishanth wrote:
 On Thu, May 12, 2011 at 01:42, Santosh Shilimkar
 santosh.shilim...@ti.com wrote:

 It's a well known problem if the udelay() is based of global lpj.
 You can read more here [1]

 Regards
 Santosh
 [1] http://eeek.borgchat.net/lists/arm-kernel/msg120702.html
 I am curious about this topic now.
 Searching Russel's patchworks for this:
 http://www.arm.linux.org.uk/developer/patches/search.php?summary=udelay
 I see nothing queued. What is the recommendation for udelay?

 The patches are sitting in Russell's patch tracker, waiting for him to
 accept/reject them.

 http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6874/1
 http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6875/1
 http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6873/1

thanks for the same and hope these do get through :)

Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC] dmaengine: add new api for preparing simple slave transfer

2011-06-13 Thread Raju, Sundaram
Linus,

Thanks for the pointers.

 -Original Message-
 From: Linus Walleij [mailto:linus.wall...@linaro.org]
 Sent: Monday, June 13, 2011 7:43 PM
 To: Raju, Sundaram
 Cc: Russell King - ARM Linux; Koul, Vinod; Dan; davinci-linux-open-
 sou...@linux.davincidsp.com; linux-omap@vger.kernel.org; linux-
 ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org
 Subject: Re: [RFC] dmaengine: add new api for preparing simple slave transfer
 
 On Fri, Jun 10, 2011 at 3:33 PM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
  On Fri, Jun 10, 2011 at 05:18:46PM +0530, Raju, Sundaram wrote:
  Now DMACs capable of 3D transfer, do transfer of the whole 1D
  buffer per sync received or even whole 2D buffer per sync received
  (based on the sync rate programmed in the DMAC).
 
  The only issue which I see that we don't cover is the case where you want
  to describe a single buffer which is organised as N bytes to be transferred,
  M following bytes to be skipped, N bytes to be transferred, M bytes to be
  skipped.  I doubt there are many controllers which can be programmed with
  both 'N' and 'M' parameters directly.
 
 Sundaram is this how your controller works?
 I mean the hardware can skip over sequences like this?
 
 When we added the config interface to DMAengine I originally included
 a custom config call, but Dan wanted me to keep it out until we
 had some specific usecase for it. FSLDMA recently started
 to use it.
 
 Notice how dmaengine_slave_config() is implemented:
 
 static inline int dmaengine_slave_config(struct dma_chan *chan,
 struct dma_slave_config *config)
 {
   return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
   (unsigned long)config);
 }
 
 So what is passed to the driver is just an unsigned long.
 
 This is actually modeled to be ioctl()-like so you can pass in a
 custom config to the same callback on the device driver,
 just use some other enumerator than DMA_SLAVE_CONFIG,
 say like FSLDMA already does with FSLDMA_EXTERNAL_START.
 
 Just put some enumerator in enum dma_ctrl_cmd in
 dmaengine.h such as SDMA_TEXAS_STRIDE_CONFIG and call
 like this:
 
 /* However that config struct needs to look, basically */
 static struct sdma_ti_stride_cgf = {
  take = M,
  skip = N,
 };
 
 ret = chan-device-device_control(chan, SDMA_TEXAS_STRIDE_CONFIG,
 sdma_ti_stride_cfg);
 
 Or something like this.

Yes, the hardware can skip over sequences like that.
I also thought about your suggestion, at first before submitting the RFC.
But I dint pursue this because, this ioctl() call has to be made before
every single prepare call.

I may have to end up using this if we decide not to change the API
signature for prepare APIs.

I actually intend to use this for all DMAC related ioctl(). Configuring
the DMAC and programming various modes etc specific to the
DMAC. I suppose this is the only way to do it.
Let me know if there is any other way to do it.

Thanks,
Sundaram
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html