Re: [PATCH 3/6] mfd: twl4030-power: Add generic reset configuration

2014-06-04 Thread Matthias Brugger
2014-05-27 20:08 GMT+02:00 Tony Lindgren :
> The twl4030 PMIC needs to be configured properly for things like
> warm reset and deeper idle states so the PMIC manages the regulators
> properly based on the hardware triggers from the SoC. Earlier
> we have configured twl4030 using platform data, but we want to
> do it for device tree based booting also.
>
> In some cases configuring twl4030 is needed for things to work.
> For example, when rebooting an OMAP3530 at 125 MHz, it hangs.
> With this patch, TWL4030 will be reset when a warm reset occures,
> and OMAP3530 does not hang on reboot.
>
> Let's add device tree support and configure things for warm reset
> as the default when compatible = "ti,twl4030-power". More
> complicated configurations can be added to the driver based on
> other compatible flags.
>
> Note we now also make the pdata const like it should be.
> This allows use it for match->data with the device tree
> related functions.
>
> Based on earlier patch by Matthias Brugger 
> and Lesly A M .
>
> Cc: Matthias Brugger 
> Cc: Robert Nelson 
> Cc: Peter De Schrijver 
> Cc: Samuel Ortiz 
> Cc: Lee Jones 
> Signed-off-by: Tony Lindgren 
> ---
>  .../devicetree/bindings/mfd/twl4030-power.txt  |   7 +-
>  drivers/mfd/twl4030-power.c| 109 
> ++---
>  include/linux/i2c/twl.h|   3 +
>  3 files changed, 105 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/twl4030-power.txt 
> b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
> index 8e15ec3..b906116 100644
> --- a/Documentation/devicetree/bindings/mfd/twl4030-power.txt
> +++ b/Documentation/devicetree/bindings/mfd/twl4030-power.txt
> @@ -5,7 +5,12 @@ to control the power resources, including power scripts. For 
> now, the
>  binding only supports the complete shutdown of the system after poweroff.
>
>  Required properties:
> -- compatible : must be "ti,twl4030-power"
> +- compatible : must be one of the following
> +   "ti,twl4030-power"
> +   "ti,twl4030-power-reset"
> +
> +The use of ti,twl4030-power-reset is recommended at least on
> +3530 that needs a special configuration for warm reset to work.
>
>  Optional properties:
>  - ti,use_poweroff: With this flag, the chip will initiates an ACTIVE-to-OFF 
> or
> diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> index 0b037dc..cb5b0cb 100644
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -29,6 +29,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>
> @@ -128,6 +129,40 @@ static u8 res_config_addrs[] = {
> [RES_MAIN_REF]  = 0x94,
>  };
>
> +/*
> + * Usable values for .remap_sleep and .remap_off
> + * Based on table "5.3.3 Resource Operating modes"
> + */
> +enum {
> +   TWL_REMAP_OFF = 0,
> +   TWL_REMAP_SLEEP = 8,
> +   TWL_REMAP_ACTIVE = 9,

Do we really need remap active?
As far as I can see it's not used anywhere.

> +};
> +
> +/*
> + * Macros to configure the PM register states for various resources.
> + * Note that we can make MSG_SINGULAR etc private to this driver once
> + * omap3 has been made DT only.
> + */
> +#define TWL_DFLT_DELAY 2   /* typically 2 32 KiHz cycles */
> +#define TWL_RESOURCE_SET(res, state)   \
> +   { MSG_SINGULAR(DEV_GRP_NULL, (res), (state)), TWL_DFLT_DELAY }
> +#define TWL_RESOURCE_ON(res)   TWL_RESOURCE_SET(res, RES_STATE_ACTIVE)
> +#define TWL_RESOURCE_OFF(res)  TWL_RESOURCE_SET(res, RES_STATE_OFF)
> +#define TWL_RESOURCE_RESET(res)TWL_RESOURCE_SET(res, RES_STATE_WRST)
> +/*
> + * It seems that type1 and type2 is just the resource init order
> + * number for the type1 and type2 group.
> + */
> +#define TWL_RESOURCE_GROUP_RESET(group, type1, type2)  \
> +   { MSG_BROADCAST(DEV_GRP_NULL, (group), (type1), (type2),\
> +   RES_STATE_WRST), TWL_DFLT_DELAY }
> +#define TWL_REMAP_SLEEP(res, devgrp, typ, typ2)  
>   \
> +   { .resource = (res), .devgroup = (devgrp),  \
> + .type = (typ), .type2 = (typ2),   \
> + .remap_off = TWL_REMAP_OFF,   \
> + .remap_sleep = TWL_REMAP_SLEEP, }
> +
>  static int twl4030_write_script_byte(u8 address, u8 byte)
>  {
> int err;
> @@ -502,7 +537,8 @@ int twl4030_remove_script(u8 flags)
> return err;
>  }
>
> -static int twl4030_power_configure_scripts(struct twl4030_power_data *pda

[PATCH] spi: spi-omap2-mcspi.c: Add dts for slave device configuration.

2013-03-25 Thread Matthias Brugger
TI omap2 mcspi allows the slave devices to configure the behavior of
the SPI master. This patch adds device tree support to the existing
options.

Signed-off-by: Matthias Brugger 
---
 Documentation/devicetree/bindings/spi/omap-spi.txt | 23 
 drivers/spi/spi-omap2-mcspi.c  | 41 ++
 2 files changed, 64 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/omap-spi.txt 
b/Documentation/devicetree/bindings/spi/omap-spi.txt
index 938809c..fef16bf 100644
--- a/Documentation/devicetree/bindings/spi/omap-spi.txt
+++ b/Documentation/devicetree/bindings/spi/omap-spi.txt
@@ -10,8 +10,20 @@ Required properties:
  input. The default is D0 as input and
  D1 as output.
 
+SPI Controller specific data in SPI slave nodes:
+
+- The spi slave nodes can provide the following information which is used
+  by the spi controller.
+
+- ti,spi-cs-per-word: Set chipselect to be toggled on every word send.
+
+- ti,spi-turbo-mode: Set turbo mode for this device.
+
+
 Example:
 
+- SoC Specific Portion:
+
 mcspi1: mcspi@1 {
 #address-cells = <1>;
 #size-cells = <0>;
@@ -20,3 +32,14 @@ mcspi1: mcspi@1 {
 ti,spi-num-cs = <4>;
 };
 
+- Board Specific Portion:
+
+   spi-device@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   controller-data {
+   ti,spi-cs-per-word = <1>;
+   ti,spi-turbo-mode = <0>;
+   };
+   };
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 893c3d7..1ae5009 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -731,11 +731,47 @@ static u32 omap2_mcspi_calc_divisor(u32 speed_hz)
return 15;
 }
 
+static struct omap2_mcspi_device_config *omap2_mcspi_get_slave_ctrldata(
+   struct spi_device *spi)
+{
+   struct omap2_mcspi_device_config *cd;
+   struct device_node *slave_np, *data_np = NULL;
+
+   slave_np = spi->dev.of_node;
+   if (!slave_np) {
+   dev_err(&spi->dev, "device node not found\n");
+   return ERR_PTR(-EINVAL);
+   }
+
+   data_np = of_get_child_by_name(slave_np, "controller-data");
+   if (!data_np) {
+   dev_err(&spi->dev, "child node 'controller-data' not found\n");
+   return ERR_PTR(-EINVAL);
+   }
+
+   cd = kzalloc(sizeof(*cd), GFP_KERNEL);
+   if (!cd) {
+   dev_err(&spi->dev, "could not allocate memory for controller 
data\n");
+   of_node_put(data_np);
+   return ERR_PTR(-ENOMEM);
+   }
+
+   if (of_get_property(data_np, "ti,spi-cs-per-word", NULL))
+   cd->cs_per_word = 1;
+
+   if (of_get_property(data_np, "ti,spi-turbo-mode", NULL))
+   cd->turbo_mode = 1;
+
+   of_node_put(data_np);
+   return cd;
+}
+
 /* called only when no transfer is active to this device */
 static int omap2_mcspi_setup_transfer(struct spi_device *spi,
struct spi_transfer *t)
 {
struct omap2_mcspi_cs *cs = spi->controller_state;
+   struct omap2_mcspi_device_config *cd = spi->controller_data;
struct omap2_mcspi *mcspi;
struct spi_master *spi_cntrl;
u32 l = 0, div = 0;
@@ -745,6 +781,11 @@ static int omap2_mcspi_setup_transfer(struct spi_device 
*spi,
mcspi = spi_master_get_devdata(spi->master);
spi_cntrl = mcspi->master;
 
+   if (!cd && spi->dev.of_node) {
+   cd = omap2_mcspi_get_slave_ctrldata(spi);
+   spi->controller_data = cd;
+   }
+
if (t != NULL && t->bits_per_word)
word_len = t->bits_per_word;
 
-- 
1.7.11.7

--
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] omap2: twl-common: Add default power configuration

2013-03-08 Thread Matthias Brugger
Hello Tony and Peter,

2013/2/19 Peter Ujfalusi :
> Hi Matthias,
>
> On 02/15/2013 04:59 PM, Matthias Brugger wrote:
>> 2013/2/1 Tony Lindgren :
>>> Hi,
>>>
>>> * Robert Nelson  [130124 07:58]:
>>>> On Wed, Jan 23, 2013 at 12:50 PM, Matthias Brugger
>>>>  wrote:
>>>>> This patch adds a generic power script configuration.
>>>>> When rebooting an OMAP3530 at 125 MHz, the reboot hangs.
>>>>> With the generic power script, TWL4030 will be reset
>>>>> when a warm reset occures. This way the OMAP3530 does not
>>>>> hang on reboot.
>>>
>>> Both look OK to me. I've added Peter to cc, it's best that he queues
>>> all the twl changes.
>>>
>>
>> Peter any comments on this patch?
>
> The patch looks good to me as well.

It looks like the patch wasn't added to the 3.9 series. Is there any
reason for that, or was it just a misunderstanding between you two,
about who will push it to Linus?

Cheers,
Matthias

>
>> Are you maintaining the whole twl4030 support or just the codec driver?
>
> Right now I'm maintaining the audio support (audio MFD, vibra, ASoC) in twl*
> While I have done some cleanup in the twl-core and related drivers recently
> and I'm reviewing patches sent for any *twl* driver (if I'm in the CC) I have
> not declared myself as Maintainer of the twl stack.
> The problem with the twl stack is that the drivers are spread around in
> different subsystem so if one takes maintainer responsibility for the stack,
> he/she need to have several entries in MAINTAINERS file to cover twl. I still
> don't think it is a good idea to 'bloat' the MAINTAINERS file for this.
> I'm happy to review patches. About a year ago we had internal discussion
> regarding to twl in upstream and Tero Kristo 'volunteered' to review patches
> as well.
>
> I still think that the twl patches should be queued via the corresponding
> subsystem (OMAP, MFD, Input, GPIO, PWM, etc).
>
> --
> Péter
>
>>
>> Best regards,
>> Matthias
>>
>>
>>> Regards,
>>>
>>> Tony
>>>
>>>>> Signed-off-by: Matthias Brugger 
>>>>> ---
>>>>>  arch/arm/mach-omap2/twl-common.c | 38 
>>>>> ++
>>>>>  arch/arm/mach-omap2/twl-common.h |  1 +
>>>>>  2 files changed, 39 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm/mach-omap2/twl-common.c 
>>>>> b/arch/arm/mach-omap2/twl-common.c
>>>>> index e49b40b..f096beb 100644
>>>>> --- a/arch/arm/mach-omap2/twl-common.c
>>>>> +++ b/arch/arm/mach-omap2/twl-common.c
>>>>> @@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata = 
>>>>> {
>>>>> .codec = &omap3_codec,
>>>>>  };
>>>>>
>>>>> +static struct twl4030_ins wrst_seq[] __initdata = {
>>>>> +   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
>>>>> +   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
>>>>> +   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
>>>>> +   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
>>>>> +   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
>>>>> +   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
>>>>> +};
>>>>> +
>>>>> +static struct twl4030_script wrst_script __initdata = {
>>>>> +   .script = wrst_seq,
>>>>> +   .size   = ARRAY_SIZE(wrst_seq),
>>>>> +   .flags  = TWL4030_WRST_SCRIPT,
>>>>> +};
>>>>> +
>>>>> +static struct twl4030_script *omap3_power_scripts[] __initdata = {
>>>>> +   &wrst_script,
>>>>> +};
>>>>> +
>>>>> +static struct twl4030_resconfig omap3_rconfig[] = {
>>>>> +   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
>>>>> +   .type2 = -1 },
>>>>> +   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
>>>>> +   .type2 = -1 },
>>>>> +   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
>>>>> +   .type2 = -1 },
>>>>> +   { 0, 0},
>>>>> +};
>>>>> +
>>>>> +static struct twl4030_power_data omap3_power_pdata = {
>>>>> +

Re: omapdss wakeup issues

2013-03-06 Thread Matthias Brugger
2013/3/5 Andreas Müller :
> On Fri, Mar 1, 2013 at 10:07 PM, Andreas Müller
>  wrote:
>> On Thu, Feb 28, 2013 at 5:27 PM, Andreas Müller
>>  wrote:
>>> Hi,
>>>
>>> I am preparing 3.8 mainline for gumstix overo and have the following
>>> issue: waking Monitor connected by HDMI from power save makes Monitor
>>> complain for unsupported frequency and console says:
>>>
>>> | omapdss APPLY error: FIFO UNDERFLOW on gfx, disabling the overlay
>>>
>>> Is this a known issue?
>>>
>> Sorry for the noise but this is the only issue I have with 3.8.1
>> stable (currently). Some further notes:
>>
>> * with old OMAP 3530 (only 600MHz capable) the HDMI does not work for
>> warm restart and not for pressing reset. The only way out is power-off
>> / power on. This I saw with 3.6 the first time but I did not follow it
>> at that time.
>> * My kernel command line is
>> console=ttyO2,115200n8 mpurate=800 vram=12M
>> omapfb.mode=dvi:1280x1024MR-24@60 omapdss.def_disp=dvi
>> root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
>>  I added omapdss.debug=y and omapdss.debug=1 but that did give me
>> further information. Are there other settings available helping to
>> debug this?
>> * I attached kernel config and bootlog for proper start - maybe this
>> gives some hint.
>> * Monitor power down is caused by XFCE power management
>>
>> Is there any other information I can give to solve this?
>>
> FWIW DM3730 (Overo fire storm) the wakeup causes some additional warning

It happens on DM3730 right now as well.
That's bad news.
When I was working on the problem I read this discussion, maybe it can help you:
http://thread.gmane.org/gmane.linux.ports.arm.omap/76021/focus=76030

>
> omapdss APPLY error: FIFO UNDERFLOW on gfx, disabling the overlay
> [ cut here ]
> WARNING: at drivers/video/omap2/dss/dispc.c:543 dispc_mgr_go+0x20/0x54()
> Modules linked in: libertas_sdio libertas lib80211 cfg80211 rfkill
> ads7846 gpio_keys
> [] (unwind_backtrace+0x0/0xe0) from []
> (warn_slowpath_common+0x4c/0x64)
> [] (warn_slowpath_common+0x4c/0x64) from []
> (warn_slowpath_null+0x18/0x1c)
> [] (warn_slowpath_null+0x18/0x1c) from []
> (dispc_mgr_go+0x20/0x54)
> [] (dispc_mgr_go+0x20/0x54) from []
> (dispc_error_worker+0x6c/0x18c)
> [] (dispc_error_worker+0x6c/0x18c) from []
> (process_one_work+0x1fc/0x3dc)
> [] (process_one_work+0x1fc/0x3dc) from []
> (worker_thread+0x238/0x34c)
> [] (worker_thread+0x238/0x34c) from [] (kthread+0xa0/0xb0)
> [] (kthread+0xa0/0xb0) from [] (ret_from_fork+0x14/0x3c)
> ---[ end trace 40fcd9df3dd2aaf5 ]---
>
> Andreas
> --
> 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



-- 
---
motzblog.wordpress.com
--
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: omapdss wakeup issues

2013-03-01 Thread Matthias Brugger
Hi Andreas,

2013/2/28 Andreas Müller :
> Hi,
>
> I am preparing 3.8 mainline for gumstix overo and have the following
> issue: waking Monitor connected by HDMI from power save makes Monitor
> complain for unsupported frequency and console says:
>
> | omapdss APPLY error: FIFO UNDERFLOW on gfx, disabling the overlay
>
> Is this a known issue?

I'm not sure if it's the same issue, but you might give it a shot.
The problem is, that when changing the CPU frequency in OMAP3530, the
frequency of L3 is changed. This frequency is used in DSS.
The result is a fifo underflow on gfx.

First check, if you use some dynamic cpufreq governor, which might be
changing the frequency.
A workaround (although not very nice) is to set fixed l3_main values
in mach-omap2/opp3xxx_data.c

Best regards,
Matthias

>
> Andreas
> --
> 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



-- 
---
motzblog.wordpress.com
--
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] omap2: twl-common: Add default power configuration

2013-02-15 Thread Matthias Brugger
2013/2/1 Tony Lindgren :
> Hi,
>
> * Robert Nelson  [130124 07:58]:
>> On Wed, Jan 23, 2013 at 12:50 PM, Matthias Brugger
>>  wrote:
>> > This patch adds a generic power script configuration.
>> > When rebooting an OMAP3530 at 125 MHz, the reboot hangs.
>> > With the generic power script, TWL4030 will be reset
>> > when a warm reset occures. This way the OMAP3530 does not
>> > hang on reboot.
>
> Both look OK to me. I've added Peter to cc, it's best that he queues
> all the twl changes.
>

Peter any comments on this patch?
Are you maintaining the whole twl4030 support or just the codec driver?

Best regards,
Matthias


> Regards,
>
> Tony
>
>> > Signed-off-by: Matthias Brugger 
>> > ---
>> >  arch/arm/mach-omap2/twl-common.c | 38 
>> > ++
>> >  arch/arm/mach-omap2/twl-common.h |  1 +
>> >  2 files changed, 39 insertions(+)
>> >
>> > diff --git a/arch/arm/mach-omap2/twl-common.c 
>> > b/arch/arm/mach-omap2/twl-common.c
>> > index e49b40b..f096beb 100644
>> > --- a/arch/arm/mach-omap2/twl-common.c
>> > +++ b/arch/arm/mach-omap2/twl-common.c
>> > @@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata = {
>> > .codec = &omap3_codec,
>> >  };
>> >
>> > +static struct twl4030_ins wrst_seq[] __initdata = {
>> > +   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
>> > +   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
>> > +};
>> > +
>> > +static struct twl4030_script wrst_script __initdata = {
>> > +   .script = wrst_seq,
>> > +   .size   = ARRAY_SIZE(wrst_seq),
>> > +   .flags  = TWL4030_WRST_SCRIPT,
>> > +};
>> > +
>> > +static struct twl4030_script *omap3_power_scripts[] __initdata = {
>> > +   &wrst_script,
>> > +};
>> > +
>> > +static struct twl4030_resconfig omap3_rconfig[] = {
>> > +   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
>> > +   .type2 = -1 },
>> > +   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
>> > +   .type2 = -1 },
>> > +   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
>> > +   .type2 = -1 },
>> > +   { 0, 0},
>> > +};
>> > +
>> > +static struct twl4030_power_data omap3_power_pdata = {
>> > +   .scripts= omap3_power_scripts,
>> > +   .num= ARRAY_SIZE(omap3_power_scripts),
>> > +   .resource_config = omap3_rconfig,
>> > +};
>> > +
>> >  static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
>> > REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
>> >  };
>> > @@ -224,6 +259,9 @@ void __init omap3_pmic_get_config(struct 
>> > twl4030_platform_data *pmic_data,
>> > if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio)
>> > pmic_data->audio = &omap3_audio_pdata;
>> >
>> > +   if (pdata_flags & TWL_COMMON_PDATA_POWER && !pmic_data->power)
>> > +   pmic_data->power = &omap3_power_pdata;
>> > +
>> > /* Common regulator configurations */
>> > if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && 
>> > !pmic_data->vdac)
>> > pmic_data->vdac = &omap3_vdac_idata;
>> > diff --git a/arch/arm/mach-omap2/twl-common.h 
>> > b/arch/arm/mach-omap2/twl-common.h
>> > index dcfbad5..dbeb905 100644
>> > --- a/arch/arm/mach-omap2/twl-common.h
>> > +++ b/arch/arm/mach-omap2/twl-common.h
>> > @@ -7,6 +7,7 @@
>> >  #define TWL_COMMON_PDATA_BCI   (1 << 1)
>> >  #define TWL_COMMON_PDATA_MADC  (1 << 2)
>> >  #define TWL_COMMON_PDATA_AUDIO (1 << 3)
>> > +#define TWL_COMMON_PDATA_POWER (1 << 4)
>> >
>> >  /* Common LDO regulators for TWL4030/TWL6030 */
>> >  #define TWL_COMMON_REGULATOR_VDAC  (1 << 0)
>> > --
>> > 1.7.11.7
>>
>> Thanks f

Re: [PATCH] arm: dts: Add uart1 and uart2 to igep boards.

2013-02-15 Thread Matthias Brugger
2013/1/26 Javier Martinez Canillas :
> On Sat, Jan 26, 2013 at 4:16 PM, Matthias Brugger 
> wrote:
>> Hi Benoit,
>>
>> 2012/12/12 Benoit Cousson :
>>> Hi Matthias,
>>>
>>> On 12/12/2012 04:33 PM, Matthias Brugger wrote:
>>>> This patch is a follow-up patch for Javier Martinez effort adding
>>>> initial
>>>> device tree support to IGEP technology devices. [1]
>>>>
>>>> It adds uart1 and uart2 bindings to the generic dtsi for the IGEP
>>>> boards.
>>>>
>>>> [1] http://www.spinics.net/lists/linux-omap/msg83409.html
>>>>
>>>> Signed-off-by: Matthias Brugger 
>>>> ---
>>>>  arch/arm/boot/dts/omap3-igep.dtsi |   24 
>>>>  1 file changed, 24 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/omap3-igep.dtsi
>>>> b/arch/arm/boot/dts/omap3-igep.dtsi
>>>> index 125fe00..c02e3c0 100644
>>>> --- a/arch/arm/boot/dts/omap3-igep.dtsi
>>>> +++ b/arch/arm/boot/dts/omap3-igep.dtsi
>>>> @@ -27,6 +27,20 @@
>>>>  };
>>>>
>>>>  &omap3_pmx_core {
>>>> + uart1_pins: pinmux_uart1_pins {
>>>> + pinctrl-single,pins = <
>>>> + 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0
>>>> */
>>>> + 0x14c 0 /* uart1_tx.uart1_tx OUTPUT |
>>>> MODE0 */
>>>> + >;
>>>> + };
>>>> +
>>>> + uart2_pins: pinmux_uart2_pins {
>>>> + pinctrl-single,pins = <
>>>> + 0x14a 0x100 /* uart2_rx.uart2_rx INPUT | MODE0
>>>> */
>>>> + 0x148 0 /* uart2_tx.uart2_tx OUTPUT |
>>>> MODE0 */
>>>> + >;
>>>> + };
>>>> +
>>>>   uart3_pins: pinmux_uart3_pins {
>>>>   pinctrl-single,pins = <
>>>>   0x16e 0x100 /* uart3_rx.uart3_rx INPUT | MODE0
>>>> */
>>>> @@ -77,6 +91,16 @@
>>>>   status = "disabled";
>>>>  };
>>>>
>>>> +&uart1 {
>>>> +   pinctrl-names = "default";
>>>> +   pinctrl-0 = <&uart1_pins>;
>>>> +};
>>>> +
>>>> +&uart2 {
>>>> +   pinctrl-names = "default";
>>>> +   pinctrl-0 = <&uart2_pins>;
>>>> +};
>>>> +
>>>>  &uart3 {
>>>> pinctrl-names = "default";
>>>> pinctrl-0 = <&uart3_pins>;
>>>>
>>>
>>> That looks good to me. I'll apply it on top of javier's series for 3.9.
>>
>> Can you pin-point me to the repository where this patches are in right
>> now? I tried to figure it out these days, but didn't found where to
>> clone the repository from.
>>
>> Thanks,
>> Matthias
>>
>
> Hi Matthias,
>
> OMAP DT tree is:
> git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git

Hi all,

unfortunately I can't find the patch in this tree.
Benoit, can you pin point me to the right tree/branch? (I had a look
in for_3.9/dts branch).

Thanks,
Matthias

>
> Hope it helps,
> Javier



-- 
---
motzblog.wordpress.com
--
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] arm: dts: Add uart1 and uart2 to igep boards.

2013-01-26 Thread Matthias Brugger
Hi Benoit,

2012/12/12 Benoit Cousson :
> Hi Matthias,
>
> On 12/12/2012 04:33 PM, Matthias Brugger wrote:
>> This patch is a follow-up patch for Javier Martinez effort adding initial
>> device tree support to IGEP technology devices. [1]
>>
>> It adds uart1 and uart2 bindings to the generic dtsi for the IGEP boards.
>>
>> [1] http://www.spinics.net/lists/linux-omap/msg83409.html
>>
>> Signed-off-by: Matthias Brugger 
>> ---
>>  arch/arm/boot/dts/omap3-igep.dtsi |   24 
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/omap3-igep.dtsi 
>> b/arch/arm/boot/dts/omap3-igep.dtsi
>> index 125fe00..c02e3c0 100644
>> --- a/arch/arm/boot/dts/omap3-igep.dtsi
>> +++ b/arch/arm/boot/dts/omap3-igep.dtsi
>> @@ -27,6 +27,20 @@
>>  };
>>
>>  &omap3_pmx_core {
>> + uart1_pins: pinmux_uart1_pins {
>> + pinctrl-single,pins = <
>> + 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */
>> + 0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */
>> + >;
>> + };
>> +
>> + uart2_pins: pinmux_uart2_pins {
>> + pinctrl-single,pins = <
>> + 0x14a 0x100 /* uart2_rx.uart2_rx INPUT | MODE0 */
>> + 0x148 0 /* uart2_tx.uart2_tx OUTPUT | MODE0 */
>> + >;
>> + };
>> +
>>   uart3_pins: pinmux_uart3_pins {
>>   pinctrl-single,pins = <
>>   0x16e 0x100 /* uart3_rx.uart3_rx INPUT | MODE0 */
>> @@ -77,6 +91,16 @@
>>   status = "disabled";
>>  };
>>
>> +&uart1 {
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <&uart1_pins>;
>> +};
>> +
>> +&uart2 {
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <&uart2_pins>;
>> +};
>> +
>>  &uart3 {
>> pinctrl-names = "default";
>> pinctrl-0 = <&uart3_pins>;
>>
>
> That looks good to me. I'll apply it on top of javier's series for 3.9.

Can you pin-point me to the repository where this patches are in right
now? I tried to figure it out these days, but didn't found where to
clone the repository from.

Thanks,
Matthias

>
> Thanks,
> Benoit
>



-- 
---
motzblog.wordpress.com
--
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 v2] spi: spi-omap2-mcspi.c: Toggle CS after each word

2013-01-24 Thread Matthias Brugger
This patch allows the board code to define SPI devices which needs to
toggle the chip select after every word send. This is needed to get a
better resolution reading e.g. an ADC data stream.
Apart from that, as in the normal code CS is controlled by software,
a transfer is done much faster.

Signed-off-by: Matthias Brugger 
---
 drivers/spi/spi-omap2-mcspi.c | 18 ++
 include/linux/platform_data/spi-omap2-mcspi.h |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 31f6e84..12789fc 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -927,6 +927,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
 
struct spi_device   *spi;
struct spi_transfer *t = NULL;
+   struct spi_master   *master;
int cs_active = 0;
struct omap2_mcspi_cs   *cs;
struct omap2_mcspi_device_config *cd;
@@ -935,6 +936,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
u32 chconf;
 
spi = m->spi;
+   master = spi->master;
cs = spi->controller_state;
cd = spi->controller_data;
 
@@ -952,6 +954,14 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
if (!t->speed_hz && !t->bits_per_word)
par_override = 0;
}
+   if (cd && cd->cs_per_word) {
+   chconf = mcspi->ctx.modulctrl;
+   chconf &= ~OMAP2_MCSPI_MODULCTRL_SINGLE;
+   mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf);
+   mcspi->ctx.modulctrl =
+   mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
+   }
+
 
if (!cs_active) {
omap2_mcspi_force_cs(spi, 1);
@@ -1013,6 +1023,14 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
if (cs_active)
omap2_mcspi_force_cs(spi, 0);
 
+   if (cd && cd->cs_per_word) {
+   chconf = mcspi->ctx.modulctrl;
+   chconf |= OMAP2_MCSPI_MODULCTRL_SINGLE;
+   mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf);
+   mcspi->ctx.modulctrl =
+   mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
+   }
+
omap2_mcspi_set_enable(spi, 0);
 
m->status = status;
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h 
b/include/linux/platform_data/spi-omap2-mcspi.h
index a65572d..c100456 100644
--- a/include/linux/platform_data/spi-omap2-mcspi.h
+++ b/include/linux/platform_data/spi-omap2-mcspi.h
@@ -22,6 +22,9 @@ struct omap2_mcspi_dev_attr {
 
 struct omap2_mcspi_device_config {
unsigned turbo_mode:1;
+
+   /* toggle chip select after every word */
+   unsigned cs_per_word:1;
 };
 
 #endif
-- 
1.7.11.7

--
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] spi: spi-omap2-mcspi.c: fix coding style

2013-01-24 Thread Matthias Brugger
This patch fixes some indentation errors.

Signed-off-by: Matthias Brugger 
---
 drivers/spi/spi-omap2-mcspi.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index b610f52..31f6e84 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1020,7 +1020,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
 }
 
 static int omap2_mcspi_transfer_one_message(struct spi_master *master,
-   struct spi_message *m)
+   struct spi_message *m)
 {
struct omap2_mcspi  *mcspi;
struct spi_transfer *t;
@@ -1041,7 +1041,7 @@ static int omap2_mcspi_transfer_one_message(struct 
spi_master *master,
|| (len && !(rx_buf || tx_buf))
|| (t->bits_per_word &&
(  t->bits_per_word < 4
-   || t->bits_per_word > 32))) {
+  || t->bits_per_word > 32))) {
dev_dbg(mcspi->dev, "transfer: %d Hz, %d %s%s, %d 
bpw\n",
t->speed_hz,
len,
@@ -1052,8 +1052,8 @@ static int omap2_mcspi_transfer_one_message(struct 
spi_master *master,
}
if (t->speed_hz && t->speed_hz < (OMAP2_MCSPI_MAX_FREQ >> 15)) {
dev_dbg(mcspi->dev, "speed_hz %d below minimum %d Hz\n",
-   t->speed_hz,
-   OMAP2_MCSPI_MAX_FREQ >> 15);
+   t->speed_hz,
+   OMAP2_MCSPI_MAX_FREQ >> 15);
return -EINVAL;
}
 
@@ -1099,7 +1099,7 @@ static int omap2_mcspi_master_setup(struct omap2_mcspi 
*mcspi)
return ret;
 
mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE,
-   OMAP2_MCSPI_WAKEUPENABLE_WKEN);
+   OMAP2_MCSPI_WAKEUPENABLE_WKEN);
ctx->wakeupenable = OMAP2_MCSPI_WAKEUPENABLE_WKEN;
 
omap2_mcspi_set_master_mode(master);
@@ -1228,7 +1228,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 
sprintf(dma_ch_name, "rx%d", i);
dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-   dma_ch_name);
+   dma_ch_name);
if (!dma_res) {
dev_dbg(&pdev->dev, "cannot get DMA RX channel\n");
status = -ENODEV;
@@ -1238,7 +1238,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
mcspi->dma_channels[i].dma_rx_sync_dev = dma_res->start;
sprintf(dma_ch_name, "tx%d", i);
dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-   dma_ch_name);
+   dma_ch_name);
if (!dma_res) {
dev_dbg(&pdev->dev, "cannot get DMA TX channel\n");
status = -ENODEV;
@@ -1254,7 +1254,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl))
dev_warn(&pdev->dev,
-   "pins are not configured from the driver\n");
+   "pins are not configured from the driver\n");
 
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
-- 
1.7.11.7

--
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] omap2: twl-common: Add default power configuration

2013-01-23 Thread Matthias Brugger
This patch adds a generic power script configuration.
When rebooting an OMAP3530 at 125 MHz, the reboot hangs.
With the generic power script, TWL4030 will be reset
when a warm reset occures. This way the OMAP3530 does not
hang on reboot.

Signed-off-by: Matthias Brugger 
---
 arch/arm/mach-omap2/twl-common.c | 38 ++
 arch/arm/mach-omap2/twl-common.h |  1 +
 2 files changed, 39 insertions(+)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index e49b40b..f096beb 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata = {
.codec = &omap3_codec,
 };
 
+static struct twl4030_ins wrst_seq[] __initdata = {
+   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
+   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+};
+
+static struct twl4030_script wrst_script __initdata = {
+   .script = wrst_seq,
+   .size   = ARRAY_SIZE(wrst_seq),
+   .flags  = TWL4030_WRST_SCRIPT,
+};
+
+static struct twl4030_script *omap3_power_scripts[] __initdata = {
+   &wrst_script,
+};
+
+static struct twl4030_resconfig omap3_rconfig[] = {
+   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
+   .type2 = -1 },
+   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
+   .type2 = -1 },
+   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
+   .type2 = -1 },
+   { 0, 0},
+};
+
+static struct twl4030_power_data omap3_power_pdata = {
+   .scripts= omap3_power_scripts,
+   .num= ARRAY_SIZE(omap3_power_scripts),
+   .resource_config = omap3_rconfig,
+};
+
 static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
 };
@@ -224,6 +259,9 @@ void __init omap3_pmic_get_config(struct 
twl4030_platform_data *pmic_data,
if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio)
pmic_data->audio = &omap3_audio_pdata;
 
+   if (pdata_flags & TWL_COMMON_PDATA_POWER && !pmic_data->power)
+   pmic_data->power = &omap3_power_pdata;
+
/* Common regulator configurations */
if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
pmic_data->vdac = &omap3_vdac_idata;
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index dcfbad5..dbeb905 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -7,6 +7,7 @@
 #define TWL_COMMON_PDATA_BCI   (1 << 1)
 #define TWL_COMMON_PDATA_MADC  (1 << 2)
 #define TWL_COMMON_PDATA_AUDIO (1 << 3)
+#define TWL_COMMON_PDATA_POWER (1 << 4)
 
 /* Common LDO regulators for TWL4030/TWL6030 */
 #define TWL_COMMON_REGULATOR_VDAC  (1 << 0)
-- 
1.7.11.7

--
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] omap2: twl-common: Add default power configuration

2013-01-23 Thread Matthias Brugger
This patch adds a generic power script configuration.
When rebooting an OMAP3530 at 125 MHz, the reboot hangs.
With the generic power script, TWL4030 will be reset
when a warm reset occures. This way the OMAP3530 does not
hang on reboot.

Signed-off-by: Matthias Brugger 
---
 arch/arm/mach-omap2/twl-common.c | 41 
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index d78180c..f096beb 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -121,41 +121,40 @@ static struct twl4030_audio_data omap3_audio_pdata = {
 };
 
 static struct twl4030_ins wrst_seq[] __initdata = {
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
-   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
-   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
+   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
 };
 
 static struct twl4030_script wrst_script __initdata = {
-   .script = wrst_seq,
-   .size   = ARRAY_SIZE(wrst_seq),
-   .flags  = TWL4030_WRST_SCRIPT,
+   .script = wrst_seq,
+   .size   = ARRAY_SIZE(wrst_seq),
+   .flags  = TWL4030_WRST_SCRIPT,
 };
 
 static struct twl4030_script *omap3_power_scripts[] __initdata = {
-   &wrst_script,
+   &wrst_script,
 };
 
 static struct twl4030_resconfig omap3_rconfig[] = {
-   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
-   .type2 = -1 },
-   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
-   .type2 = -1 },
-   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
-   .type2 = -1 },
-   { 0, 0},
+   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
+   .type2 = -1 },
+   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
+   .type2 = -1 },
+   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
+   .type2 = -1 },
+   { 0, 0},
 };
 
 static struct twl4030_power_data omap3_power_pdata = {
-   .scripts= omap3_power_scripts,
-   .num= ARRAY_SIZE(omap3_power_scripts),
-   .resource_config = omap3_rconfig,
+   .scripts= omap3_power_scripts,
+   .num= ARRAY_SIZE(omap3_power_scripts),
+   .resource_config = omap3_rconfig,
 };
 
-
 static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
 };
-- 
1.7.11.7

--
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 3/3] spi: spi-omap2-mcspi.c: Toggle CS after each word

2013-01-23 Thread Matthias Brugger
This patch allows the board code to define SPI devices which needs to
toggle the chip select after every word send. This is needed to get a
better resolution reading e.g. an ADC data stream.
Apart from that, as in the normal code CS is controlled by software,
a transfer is done much faster.

Signed-off-by: Matthias Brugger 
---
 drivers/spi/spi-omap2-mcspi.c | 34 ---
 include/linux/platform_data/spi-omap2-mcspi.h |  3 +++
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index b610f52..12789fc 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -927,6 +927,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
 
struct spi_device   *spi;
struct spi_transfer *t = NULL;
+   struct spi_master   *master;
int cs_active = 0;
struct omap2_mcspi_cs   *cs;
struct omap2_mcspi_device_config *cd;
@@ -935,6 +936,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
u32 chconf;
 
spi = m->spi;
+   master = spi->master;
cs = spi->controller_state;
cd = spi->controller_data;
 
@@ -952,6 +954,14 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
if (!t->speed_hz && !t->bits_per_word)
par_override = 0;
}
+   if (cd && cd->cs_per_word) {
+   chconf = mcspi->ctx.modulctrl;
+   chconf &= ~OMAP2_MCSPI_MODULCTRL_SINGLE;
+   mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf);
+   mcspi->ctx.modulctrl =
+   mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
+   }
+
 
if (!cs_active) {
omap2_mcspi_force_cs(spi, 1);
@@ -1013,6 +1023,14 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
if (cs_active)
omap2_mcspi_force_cs(spi, 0);
 
+   if (cd && cd->cs_per_word) {
+   chconf = mcspi->ctx.modulctrl;
+   chconf |= OMAP2_MCSPI_MODULCTRL_SINGLE;
+   mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, chconf);
+   mcspi->ctx.modulctrl =
+   mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
+   }
+
omap2_mcspi_set_enable(spi, 0);
 
m->status = status;
@@ -1020,7 +1038,7 @@ static void omap2_mcspi_work(struct omap2_mcspi *mcspi, 
struct spi_message *m)
 }
 
 static int omap2_mcspi_transfer_one_message(struct spi_master *master,
-   struct spi_message *m)
+   struct spi_message *m)
 {
struct omap2_mcspi  *mcspi;
struct spi_transfer *t;
@@ -1041,7 +1059,7 @@ static int omap2_mcspi_transfer_one_message(struct 
spi_master *master,
|| (len && !(rx_buf || tx_buf))
|| (t->bits_per_word &&
(  t->bits_per_word < 4
-   || t->bits_per_word > 32))) {
+  || t->bits_per_word > 32))) {
dev_dbg(mcspi->dev, "transfer: %d Hz, %d %s%s, %d 
bpw\n",
t->speed_hz,
len,
@@ -1052,8 +1070,8 @@ static int omap2_mcspi_transfer_one_message(struct 
spi_master *master,
}
if (t->speed_hz && t->speed_hz < (OMAP2_MCSPI_MAX_FREQ >> 15)) {
dev_dbg(mcspi->dev, "speed_hz %d below minimum %d Hz\n",
-   t->speed_hz,
-   OMAP2_MCSPI_MAX_FREQ >> 15);
+   t->speed_hz,
+   OMAP2_MCSPI_MAX_FREQ >> 15);
return -EINVAL;
}
 
@@ -1099,7 +1117,7 @@ static int omap2_mcspi_master_setup(struct omap2_mcspi 
*mcspi)
return ret;
 
mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE,
-   OMAP2_MCSPI_WAKEUPENABLE_WKEN);
+   OMAP2_MCSPI_WAKEUPENABLE_WKEN);
ctx->wakeupenable = OMAP2_MCSPI_WAKEUPENABLE_WKEN;
 
omap2_mcspi_set_master_mode(master);
@@ -1228,7 +1246,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 
sprintf(dma_ch_name, "rx%d", i);
dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-   

Re: [PATCH] mach-omap2/board-igep0020.c: Fix reboot problem

2012-12-18 Thread Matthias Brugger
2012/12/14 Tony Lindgren :
> * Robert Nelson  [121115 08:44]:
>> On Thu, Nov 15, 2012 at 10:06 AM, Matthias Brugger
>>  wrote:
>> > When rebooting an OMAP3530 at 125 MHz, the reboot hangs.
>> > This patch adds a generic power save script, which resets the TWL4030 when 
>> > a
>> > warm reset occures. This way the OMAP3530 does not hang on reboot.
>> >
>> > Signed-off-by: Matthias Brugger 
>> > ---
>> >  arch/arm/mach-omap2/board-igep0020.c |   36 
>> > ++
>> >  1 file changed, 36 insertions(+)
>> >
>> > diff --git a/arch/arm/mach-omap2/board-igep0020.c 
>> > b/arch/arm/mach-omap2/board-igep0020.c
>> > index 48d5e41..9ba1c4b 100644
>> > --- a/arch/arm/mach-omap2/board-igep0020.c
>> > +++ b/arch/arm/mach-omap2/board-igep0020.c
>> > @@ -487,11 +487,47 @@ static struct twl4030_keypad_data igep2_keypad_pdata 
>> > = {
>> > .rep= 1,
>> >  };
>> >
>> > +static struct twl4030_ins wrst_seq[] __initdata = {
>> > +   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
>> > +   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
>> > +   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
>> > +};
>> > +
>> > +static struct twl4030_script wrst_script __initdata = {
>> > +   .script = wrst_seq,
>> > +   .size   = ARRAY_SIZE(wrst_seq),
>> > +   .flags  = TWL4030_WRST_SCRIPT,
>> > +};
>> > +
>> > +static struct twl4030_script *twl4030_scripts[] __initdata = {
>> > +   &wrst_script,
>> > +};
>> > +
>> > +static struct twl4030_resconfig twl4030_rconfig[] = {
>> > +   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
>> > +   .type2 = -1 },
>> > +   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
>> > +   .type2 = -1 },
>> > +   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
>> > +   .type2 = -1 },
>> > +   { 0, 0},
>> > +};
>> > +
>> > +static struct twl4030_power_data igep_twl4030_power_data = {
>> > +   .scripts= twl4030_scripts,
>> > +   .num= ARRAY_SIZE(twl4030_scripts),
>> > +   .resource_config = twl4030_rconfig,
>> > +};
>> > +
>> >  static struct twl4030_platform_data igep_twldata = {
>> > /* platform_data for children goes here */
>> > .gpio   = &igep_twl4030_gpio_pdata,
>> > .vmmc1  = &igep_vmmc1,
>> > .vio= &igep_vio,
>> > +   .power  = &igep_twl4030_power_data,
>> >  };
>> >
>> >  static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
>> > --
>> > 1.7.9.5
>> >
>> > --
>>
>> Sweet, this also fixes the software reboot lockup I've been bisecting
>> on the Beagle C4 (omap3530), when the ONDEMAND governor is enabled..
>> (applied the same changes to the beagle's board file:
>> board-omap3beagle.c)
>>
>> Can we make this script generic for all omap35xx/twl4030 boards that need it?
>>
>> So far, no regressions in a quick boot/reboot test of DM3730 Beagle xM
>> C that shares the board file...
>
> Any news on making this fix generic?
>
> Regards,
>
> Tony

I will try to have a look on it the next days.

Cheers,
Matthias


-- 
---
motzblog.wordpress.com
--
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] arm: dts: Add uart1 and uart2 to igep boards.

2012-12-12 Thread Matthias Brugger
This patch is a follow-up patch for Javier Martinez effort adding initial
device tree support to IGEP technology devices. [1]

It adds uart1 and uart2 bindings to the generic dtsi for the IGEP boards.

[1] http://www.spinics.net/lists/linux-omap/msg83409.html

Signed-off-by: Matthias Brugger 
---
 arch/arm/boot/dts/omap3-igep.dtsi |   24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-igep.dtsi 
b/arch/arm/boot/dts/omap3-igep.dtsi
index 125fe00..c02e3c0 100644
--- a/arch/arm/boot/dts/omap3-igep.dtsi
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -27,6 +27,20 @@
 };
 
 &omap3_pmx_core {
+   uart1_pins: pinmux_uart1_pins {
+   pinctrl-single,pins = <
+   0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */
+   0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */
+   >;
+   };
+
+   uart2_pins: pinmux_uart2_pins {
+   pinctrl-single,pins = <
+   0x14a 0x100 /* uart2_rx.uart2_rx INPUT | MODE0 */
+   0x148 0 /* uart2_tx.uart2_tx OUTPUT | MODE0 */
+   >;
+   };
+
uart3_pins: pinmux_uart3_pins {
pinctrl-single,pins = <
0x16e 0x100 /* uart3_rx.uart3_rx INPUT | MODE0 */
@@ -77,6 +91,16 @@
status = "disabled";
 };
 
+&uart1 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&uart1_pins>;
+};
+
+&uart2 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&uart2_pins>;
+};
+
 &uart3 {
pinctrl-names = "default";
pinctrl-0 = <&uart3_pins>;
-- 
1.7.9.5

--
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 2/3] ARM/dts: omap3: Add support for IGEPv2 board

2012-11-30 Thread Matthias Brugger

On 11/29/2012 12:14 AM, Javier Martinez Canillas wrote:

ISEE IGEPv2 is an TI OMAP3 SoC based embedded board.

This patch adds an initial device tree support to boot
an IGEPv2 from the MMC/SD.

Currently is working everything that is supported by DT
on OMAP3 SoCs (MMC/SD, GPIO LEDs, EEPROM, TWL4030 audio).

Signed-off-by: Javier Martinez Canillas 
---

Acked-by: Matthias Brugger 


  arch/arm/boot/dts/Makefile   |1 +
  arch/arm/boot/dts/omap3-igep0020.dts |   56 ++
  2 files changed, 57 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/boot/dts/omap3-igep0020.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f37cf9f..1dc0f39 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -66,6 +66,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
omap3-beagle-xm.dtb \
omap3-evm.dtb \
omap3-tobi.dtb \
+   omap3-igep0020.dtb \
omap4-panda.dtb \
omap4-pandaES.dtb \
omap4-var_som.dtb \
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts 
b/arch/arm/boot/dts/omap3-igep0020.dts
new file mode 100644
index 000..9dd4d22
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-igep0020.dts
@@ -0,0 +1,56 @@
+/*
+ * Device Tree Source for IGEPv2 board
+ *
+ * Copyright (C) 2012 Javier Martinez Canillas 
+ * Copyright (C) 2012 Enric Balletbo i Serra 
+ *
+ * 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.
+ */
+
+/include/ "omap3-igep.dtsi"
+
+/ {
+   model = "IGEPv2";
+   compatible = "isee,omap3-igep0020", "ti,omap3";
+
+   leds {
+   compatible = "gpio-leds";
+   boot {
+label = "omap3:green:boot";
+gpios = <&gpio1 26 0>;
+linux,default-trigger = "default-on";
+   };
+
+   user0 {
+label = "omap3:red:user0";
+gpios = <&gpio1 27 0>;
+default-state = "off";
+   };
+
+   user1 {
+label = "omap3:red:user1";
+gpios = <&gpio1 28 0>;
+default-state = "off";
+   };
+
+   user2 {
+   label = "omap3:green:user1";
+   gpios = <&twl_gpio 19 1>;
+   };
+   };
+};
+
+&i2c3 {
+   clock-frequency = <10>;
+
+   /*
+* Display monitor features are burnt in the EEPROM
+* as EDID data.
+*/
+   eeprom@50 {
+   compatible = "ti,eeprom";
+   reg = <0x50>;
+   };
+};



--
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/3] ARM/dts: omap3: Add generic DT support for IGEP devices

2012-11-30 Thread Matthias Brugger

On 11/29/2012 12:14 AM, Javier Martinez Canillas wrote:

Add a generic .dtsi device tree source file for the
common characteristics across IGEP Technology devices.

Signed-off-by: Javier Martinez Canillas 
---

Acked-by: Matthias Brugger 


  arch/arm/boot/dts/omap3-igep.dtsi |   93 +
  1 files changed, 93 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/boot/dts/omap3-igep.dtsi

diff --git a/arch/arm/boot/dts/omap3-igep.dtsi 
b/arch/arm/boot/dts/omap3-igep.dtsi
new file mode 100644
index 000..a093bff
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -0,0 +1,93 @@
+/*
+ * Device Tree Source for IGEP Technology devices
+ *
+ * Copyright (C) 2012 Javier Martinez Canillas 
+ * Copyright (C) 2012 Enric Balletbo i Serra 
+ *
+ * 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.
+ */
+/dts-v1/;
+
+/include/ "omap3.dtsi"
+
+/ {
+   memory {
+   device_type = "memory";
+   reg = <0x8000 0x2000>; /* 512 MB */
+   };
+
+   sound {
+   compatible = "ti,omap-twl4030";
+   ti,model = "igep2";
+   ti,mcbsp = <&mcbsp2>;
+   ti,codec = <&twl_audio>;
+   };
+};
+
+&omap3_pmx_core {
+   pinctrl-names = "default";
+   pinctrl-0 = <
+ &mcbsp2_pins
+   >;
+
+   uart3_pins: pinmux_uart3_pins {
+   pinctrl-single,pins = <
+   0x16e 0x100 /* uart3_rx.uart3_rx INPUT | MODE0 */
+   0x170 0 /* uart3_tx.uart3_tx OUTPUT | MODE0 */
+   >;
+   };
+
+   mcbsp2_pins: pinmux_mcbsp2_pins {
+   pinctrl-single,pins = <
+   0x1a2 0x0104/* mcspi1_cs2.gpio_176 INPUT | MODE4 */
+   >;
+   };
+};
+
+&i2c1 {
+   clock-frequency = <260>;
+
+   twl: twl@48 {
+   reg = <0x48>;
+   interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+   interrupt-parent = <&intc>;
+
+   vsim: regulator@10 {
+   compatible = "ti,twl4030-vsim";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <300>;
+   };
+
+   twl_audio: audio {
+   compatible = "ti,twl4030-audio";
+   codec {
+ };
+   };
+   };
+};
+
+/include/ "twl4030.dtsi"
+
+&i2c2 {
+   clock-frequency = <40>;
+};
+
+&mmc1 {
+   vmmc-supply = <&vmmc1>;
+   vmmc_aux-supply = <&vsim>;
+   bus-width = <8>;
+};
+
+&mmc2 {
+   status = "disabled";
+};
+
+&mmc3 {
+   status = "disabled";
+};
+
+&twl_gpio {
+   ti,use-leds;
+};



--
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] omap2/ompafb/omapfb-main.c: Delete if evaluating constant.

2012-11-16 Thread Matthias Brugger
Variable r is never set to any value different to zero.
Delete the if statement as it will never executed.

Signed-off-by: Matthias Brugger 
---
 drivers/video/omap2/omapfb/omapfb-main.c |4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c 
b/drivers/video/omap2/omapfb/omapfb-main.c
index 16db158..85f9de0 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2411,7 +2411,6 @@ static int __init omapfb_probe(struct platform_device 
*pdev)
fbdev->dev = &pdev->dev;
platform_set_drvdata(pdev, fbdev);
 
-   r = 0;
fbdev->num_displays = 0;
dssdev = NULL;
for_each_dss_dev(dssdev) {
@@ -2434,9 +2433,6 @@ static int __init omapfb_probe(struct platform_device 
*pdev)
d->update_mode = OMAPFB_AUTO_UPDATE;
}
 
-   if (r)
-   goto cleanup;
-
if (fbdev->num_displays == 0) {
dev_err(&pdev->dev, "no displays\n");
r = -EINVAL;
-- 
1.7.9.5

--
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] mach-omap2/board-igep0020.c: Fix reboot problem

2012-11-15 Thread Matthias Brugger
When rebooting an OMAP3530 at 125 MHz, the reboot hangs.
This patch adds a generic power save script, which resets the TWL4030 when a
warm reset occures. This way the OMAP3530 does not hang on reboot.

Signed-off-by: Matthias Brugger 
---
 arch/arm/mach-omap2/board-igep0020.c |   36 ++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm/mach-omap2/board-igep0020.c 
b/arch/arm/mach-omap2/board-igep0020.c
index 48d5e41..9ba1c4b 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -487,11 +487,47 @@ static struct twl4030_keypad_data igep2_keypad_pdata = {
.rep= 1,
 };
 
+static struct twl4030_ins wrst_seq[] __initdata = {
+   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
+   {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
+   {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+   {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+};
+
+static struct twl4030_script wrst_script __initdata = {
+   .script = wrst_seq,
+   .size   = ARRAY_SIZE(wrst_seq),
+   .flags  = TWL4030_WRST_SCRIPT,
+};
+
+static struct twl4030_script *twl4030_scripts[] __initdata = {
+   &wrst_script,
+};
+
+static struct twl4030_resconfig twl4030_rconfig[] = {
+   { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1,
+   .type2 = -1 },
+   { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1,
+   .type2 = -1 },
+   { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1,
+   .type2 = -1 },
+   { 0, 0},
+};
+
+static struct twl4030_power_data igep_twl4030_power_data = {
+   .scripts= twl4030_scripts,
+   .num= ARRAY_SIZE(twl4030_scripts),
+   .resource_config = twl4030_rconfig,
+};
+
 static struct twl4030_platform_data igep_twldata = {
/* platform_data for children goes here */
.gpio   = &igep_twl4030_gpio_pdata,
.vmmc1  = &igep_vmmc1,
.vio= &igep_vio,
+   .power  = &igep_twl4030_power_data,
 };
 
 static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = {
-- 
1.7.9.5

--
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] usb/musb/omap2430.c Delete unused variable.

2012-08-16 Thread Matthias Brugger
Variable ret is always evaluated as true, so we don't need to check it.

Signed-off-by: Matthias Brugger 
---
 drivers/usb/musb/omap2430.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 5fdb9da..2d207c6 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -140,7 +140,6 @@ static void omap2430_musb_set_vbus(struct musb *musb, int 
is_on)
struct usb_otg  *otg = musb->xceiv->otg;
u8  devctl;
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
-   int ret = 1;
/* HDRC controls CPEN, but beware current surges during device
 * connect.  They can trigger transient overcurrent conditions
 * that must be ignored.
@@ -164,12 +163,11 @@ static void omap2430_musb_set_vbus(struct musb *musb, int 
is_on)
if (time_after(jiffies, timeout)) {
dev_err(musb->controller,
"configured as A device timeout");
-   ret = -EINVAL;
break;
}
}
 
-   if (ret && otg->set_vbus)
+   if (otg->set_vbus)
otg_set_vbus(otg, 1);
} else {
musb->is_active = 1;
-- 
1.7.9.5

--
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] usb/musb/omap2430.c Delete unused variable

2012-08-16 Thread Matthias Brugger
Signed-off-by: Matthias Brugger 
---
 drivers/usb/musb/omap2430.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 5fdb9da..2d207c6 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -140,7 +140,6 @@ static void omap2430_musb_set_vbus(struct musb *musb, int 
is_on)
struct usb_otg  *otg = musb->xceiv->otg;
u8  devctl;
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
-   int ret = 1;
/* HDRC controls CPEN, but beware current surges during device
 * connect.  They can trigger transient overcurrent conditions
 * that must be ignored.
@@ -164,12 +163,11 @@ static void omap2430_musb_set_vbus(struct musb *musb, int 
is_on)
if (time_after(jiffies, timeout)) {
dev_err(musb->controller,
"configured as A device timeout");
-   ret = -EINVAL;
break;
}
}
 
-   if (ret && otg->set_vbus)
+   if (otg->set_vbus)
otg_set_vbus(otg, 1);
} else {
musb->is_active = 1;
-- 
1.7.9.5

--
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