Re: The linaro-2.6.39 kernel repository is now alive

2011-06-09 Thread Andy Green

On 06/09/2011 05:38 AM, Somebody in the thread at some point said:


http://article.gmane.org/gmane.linux.ports.arm.kernel/119896

I'm not entirely satisfied with the W() usage in there though, even less
so by the THUMB(nop) that are inserted here and there to provide proper
padding.  As the patch above shows, this is just too easy to overlook
and break.  I wish we could get rid of them and make that code a bit
more streamlined, but I have no bright idea for that at the moment.


Wow scary, great job picking up on it.


It could be a decompressor problem or similar, but actually booting
from an Image doesn't work for me either after or before the above
commit.


The early serial port usage issue I mentioned before notwitstanding,
there was actually a real bug there too, especially if you had
CONFIG_OF=y but not using any DTB.  The fix is here:

http://article.gmane.org/gmane.linux.ports.arm.kernel/119893

All those fixes plus a bunch of other fixes from mainline are now merged
in linaro-2.6.39.


I wasn't seeing it die early but that also looks like a good find.

-Andy

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Linaro 11.05 weekly testing 2011-06-09

2011-06-09 Thread Fathi Boudra
Hi,

This is a message sent out once per week to call on our community to
help test the Linaro evaluation builds we produce. If you have supported
hardware, as found on:

 http://snapshots.linaro.org/11.05-daily/linaro-hwpacks/

please help our initiative by testing the official Linaro Evaluation
Build (LEB):

Android:
 http://snapshots.linaro.org/11.05-daily/linaro-android/leb-panda/20110609/

Ubuntu:
 http://snapshots.linaro.org/11.05-daily/linaro-ubuntu-desktop/20110609/

and our Community images:

Android Mainline:
 http://snapshots.linaro.org/11.05-daily/linaro-android/beaglexm/20110609/
 http://snapshots.linaro.org/11.05-daily/linaro-android/panda/20110609/

Nano:
 http://snapshots.linaro.org/11.05-daily/linaro-nano/20110609/

ALIP:
 http://snapshots.linaro.org/11.05-daily/linaro-alip/20110609/

Developer:
 http://snapshots.linaro.org/11.05-daily/linaro-developer/20110609/

Make your way to:

 https://wiki.linaro.org/Platform/Android/ImageInstallation
 https://wiki.linaro.org/Platform/DevPlatform/Ubuntu/ImageInstallation

for an explanation on how to test and submit your results to the QA
tracker at:

 http://qatracker.linaro.org

For an explanation of how to use the qatracker please see:

 https://wiki.linaro.org/QA/QATracker

Cheers,

Fathi
--
Linaro Release Manager   |   Platform Project Manager

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: The linaro-2.6.39 kernel repository is now alive

2011-06-09 Thread Andy Green

On 06/09/2011 09:22 AM, Somebody in the thread at some point said:


All those fixes plus a bunch of other fixes from mainline are now merged
in linaro-2.6.39.


I wasn't seeing it die early but that also looks like a good find.


Just a FYI a bogus line in core cpufreq driver has crept into 
linux-linaro-2.6.39 that breaks compilation for anything with CPU_FREQ 
enabled.  This solves it -->


http://git.linaro.org/gitweb?p=people/andygreen/kernel-tilt.git;a=patch;h=8e8dc5f5e0e287acbe76fdd77ad1dfc568eb2f89

... and with omap4_defconfig anyway cpufreq seems at least to start up 
on both CPUs on Panda now, cool.


Going to have a go at omap2plus_defconfig.

-Andy

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: The linaro-2.6.39 kernel repository is now alive

2011-06-09 Thread Andy Green

On 06/09/2011 10:01 AM, Somebody in the thread at some point said:


... and with omap4_defconfig anyway cpufreq seems at least to start up
on both CPUs on Panda now, cool.

Going to have a go at omap2plus_defconfig.


omap2plus_defconfig is still blowing SIGILLs where omap4_defconfig is 
happy (these defconfigs are vs my master branch)


...
[1.816986] VFP support v0.3: implementor 41 architecture 3 part 30 
variant 9 rev 1

[1.825347] ThumbEE CPU extension supported.
...
[2.262329] Freeing init memory: 292K
init: hwclock main process (519) killed by ILL signal
init: ureadahead main process (520) terminated with status 5
init: plymouth main process (521) killed by ILL signal
udevd[552]: failed to create queue file: No such file or directory

udevd[552]: error creating queue file

init: udev main process (552) terminated with status 1
init: udev main process ended, respawning
init: udevmonitor main process (558) terminated with status 2
udevadm[822]: error sending message: Connection refused

init: udev-fallback-graphics main process (823) terminated with status 1
init: plymouth-splash main process (825) killed by ILL signal

-Andy

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


does anybody have the kernel ddeb for the 1105 omap release hwpack?

2011-06-09 Thread Peter Maydell
I'm looking for a copy of the ddeb (ie the debug info) for the omap
kernel in the 1105 release. That used to be here:

http://ddebs.ubuntu.com/pool/universe/l/linux-linaro-omap/linux-image-2.6.38-1003-linaro-omap-dbgsym_2.6.38-1003.4~ppa5_armel.ddeb

but unfortunately the archive expired it last night.

Does anybody happen to have a copy lying around that they could
send me?

(Also can we sort this out so we stop expiring the ddebs,
at least for our release kernels?)

Thanks in advance
-- PMM

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: The linaro-2.6.39 kernel repository is now alive

2011-06-09 Thread Andy Green

On 06/09/2011 10:26 AM, Somebody in the thread at some point said:


[ 2.262329] Freeing init memory: 292K
init: hwclock main process (519) killed by ILL signal


SIGILL issue requires CONFIG_ARCH_OMAP2 enabled to see it.  Disabling 
CONFIG_ARCH_OMAP2 (and fixing stuff like EXT4 and DEVTMPFS being 
disabled) gets a boot without display but no SIGILL.


-Andy

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: device tree stuff for linaro-2.6.39

2011-06-09 Thread Nicolas Pitre
On Wed, 8 Jun 2011, John Rigby wrote:

> Nicolas,
> 
> Is device tree stuff equivalent to what was in .38 going in?  I'm
> looking for the equivalent of what went into .38 in commit
> 3fb7bd037f31f5acdc213c0eb431c07a38803445
> 
>  Merge branch 'devicetree/arm-linaro-2.6.38' of
> git://git.secretlab.ca/git/linux-2.6 into linaro-2.6.38

Hmmm... In fact it looks like the machine specific bits are missing.

@Grant: what is the plan for those?  Do you have a branch with them on 
top of what went into 3.0-rc1?


Nicolas

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Linaro 11.05 weekly testing 2011-06-09

2011-06-09 Thread Bee Hock Goh
Is the hwpk image for mx51 or mx53?

On Thu, Jun 9, 2011 at 4:26 PM, Fathi Boudra  wrote:
> Hi,
>
> This is a message sent out once per week to call on our community to
> help test the Linaro evaluation builds we produce. If you have supported
> hardware, as found on:
>
>  http://snapshots.linaro.org/11.05-daily/linaro-hwpacks/
>
> please help our initiative by testing the official Linaro Evaluation
> Build (LEB):
>
> Android:
>  http://snapshots.linaro.org/11.05-daily/linaro-android/leb-panda/20110609/
>
> Ubuntu:
>  http://snapshots.linaro.org/11.05-daily/linaro-ubuntu-desktop/20110609/
>
> and our Community images:
>
> Android Mainline:
>  http://snapshots.linaro.org/11.05-daily/linaro-android/beaglexm/20110609/
>  http://snapshots.linaro.org/11.05-daily/linaro-android/panda/20110609/
>
> Nano:
>  http://snapshots.linaro.org/11.05-daily/linaro-nano/20110609/
>
> ALIP:
>  http://snapshots.linaro.org/11.05-daily/linaro-alip/20110609/
>
> Developer:
>  http://snapshots.linaro.org/11.05-daily/linaro-developer/20110609/
>
> Make your way to:
>
>  https://wiki.linaro.org/Platform/Android/ImageInstallation
>  https://wiki.linaro.org/Platform/DevPlatform/Ubuntu/ImageInstallation
>
> for an explanation on how to test and submit your results to the QA
> tracker at:
>
>  http://qatracker.linaro.org
>
> For an explanation of how to use the qatracker please see:
>
>  https://wiki.linaro.org/QA/QATracker
>
> Cheers,
>
> Fathi
> --
> Linaro Release Manager   |   Platform Project Manager
>
> ___
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Linaro 11.05 weekly testing 2011-06-09

2011-06-09 Thread Fathi Boudra
On 9 June 2011 12:05, Bee Hock Goh  wrote:
> Is the hwpk image for mx51 or mx53?

hardware pack for mx51:
http://snapshots.linaro.org/11.05-daily/linaro-hwpacks/imx51/20110609/0/images/hwpack/hwpack_linaro-imx51_20110609-0_armel_unsupported.tar.gz

hardware pack for mx53:
http://snapshots.linaro.org/11.05-daily/linaro-hwpacks/lt-mx53loco/20110609/0/images/hwpack/hwpack_linaro-lt-mx53loco_20110609-0_armel_supported.tar.gz

Cheers,

Fathi

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PM] 08/06/2011 - Minutes for the Power Management WG weekly call

2011-06-09 Thread Vincent Guittot
Hi All,

The minutes of the power management weekly call can be found at :

https://wiki.linaro.org/WorkingGroups/PowerManagement/Meetings/2011-06-08

Summary:
 * New comer : Robert Lee from Freescale.
 * Discussion about PM WG's monthly delivery.
 * Creation of a PM kernel tree with PM WG patches.
 * Powerdebug code rewrite patchset has been sent .
 * hwmon for thermal sensor of samsung platform is running

Vincent

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Likely gcc-linaro-4.5-2011.05 misoptimization in libgui (Android)

2011-06-09 Thread Ken Werner

On 05/27/2011 01:20 PM, Alexander Sack wrote:

Hi Jim,

On Fri, May 27, 2011 at 1:06 PM, Jim Huang  wrote:

Hello list,

If you build Android using gcc-linaro-4.5-2011.05 [1], you will
encounter a problem that bootanimation shows endless.  It results from
the mis-optimization in libgui, which handles the operations in
Android SensorManager.

To work around this problem, you can apply the following patch:

--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -18,6 +18,8 @@ LOCAL_SHARED_LIBRARIES := \

  LOCAL_MODULE:= libgui

+LOCAL_CFLAGS += -O0
+


in channel you said that -O1 is also working ... do we need O0 here?

one idea would be to make a list of all optimizations that come for O2
and then spin builds with adding one at a time ... in that way we can
narrow down things. Not sure if that would be helpful for fixing the
issue.


Hi there,

I've got an android build system up and running and had a quick look 
into this. When using the gcc-linaro-4.5-2011.05-0 the bootanimation 
runs forever when compiling the libgui.so using -O[s|1|2]. For me it 
only works when disabling all optizations (-O0). So, I've started with 
-O0 and tried to bisect the various  optimization switches but I didn't 
fail. Next I've started with -O1 and disabled all the optimizations but 
it didn't pass. So, this approach was a dead end. Then I realized that 
the build system employs some sort of a prelinker called apriori. Adding 
'LOCAL_PRELINK_MODULE := false' to the makefile disables the prelink 
step. And the resulting ELF binary finally worked (tested with 
-O[s|1|2]). It would be good to understand the root cause of this 
because the workaround probably has drawbacks at run (load) time. 
Apriori gets two input files. The prelink-linux-arm.map which lists the 
start of the prelink addresses:

  libui.so0xAB90 # [~1M]
  libgui.so   0xAB80 # [~1M]
  libskia.so  0xAB10 # [~2M]
and the libgui.so to be prelinked. I'd expect to see the resulting 
PhysAddr's somewhere nearby 0xAB80 but this doesn't seem to be the 
case somehow. In order to exclude a miscompiled apriori, I've prelinked 
libgui using an apriori binary build with the prebuilt gcc44 - no 
difference. Therefore I don't think gcc is miscompiling but something 
went wrong whith the prelink step. But still - the android prelinking 
remains a mystery to me as I don't know what is supposed to be prelinked 
and what is actually failing. However, I think we are one step further.


Regards
Ken

project frameworks/base/
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index 249558a..3bc7eaa 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -16,6 +16,8 @@ LOCAL_SHARED_LIBRARIES := \
 	libhardware \
 	libhardware_legacy
 
+LOCAL_PRELINK_MODULE := false
+
 LOCAL_MODULE:= libgui
 
 ifeq ($(TARGET_SIMULATOR),true)
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: SPDX [was: What do we want our hwpack sources]

2011-06-09 Thread Zach Pfeffer
On 7 June 2011 17:54, James Westby  wrote:
> On Mon, 06 Jun 2011 20:29:38 -0500, Kate Stewart  
> wrote:
>> This is a format that can go outside the packages (as well as in), so
>> can be used without marshalling the entire Debian community to adopt it.
>> So, am not advocating it be pushed by Linaro engineering for adoption
>> inside Debian packages.  Just be considered for use when describing the
>> licensing and copyrights of what you're providing, rather than come up
>> with yet another version...  ;)
>
> Right. The trigger of this discussion wasn't about describing the
> licensing and copyrights of what we are providing.
>
> Given that I don't think it's going to work for our use case, given that
> we have to specify the license details of every file we are shipping
> (files here will be .deb packages), just in order so say

Perhaps Kate can chime in. I think you just have to specify the
license as a whole.

>   this is based on 03E520A of
>   git://git.linaro.org/jcrigby/linux-linaro-natty.git
>
> I certainly think that it's a good idea to consider it if we do wish to
> describe the licenses of the files we are providing in a
> machine-readable manner.
>
> Thanks,
>
> James
>

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH] OMAPFB: Reset framebuffer after resume

2011-06-09 Thread Kan-Ru Chen
After resume the HDMI/DVI output was still blank. It turns out that
framebuffers have to be reconfigured so the output is activated again.

---
 drivers/video/omap2/omapfb/omapfb-main.c |   33 ++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c 
b/drivers/video/omap2/omapfb/omapfb-main.c
index 2bd90ca..a5a0725 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -2274,6 +2275,37 @@ static int omapfb_parse_def_modes(struct omapfb2_device 
*fbdev)
return r;
 }
 
+#ifdef CONFIG_PM
+static int omapfb_suspend(struct device *dev)
+{
+   return 0;
+}
+
+static int omapfb_resume(struct device *dev)
+{
+   struct platform_device *pdev = to_platform_device(dev);
+   struct omapfb2_device *fbdev = platform_get_drvdata(pdev);
+   int i;
+
+   if (fbdev != NULL) {
+   for (i = 0; i < fbdev->num_fbs; i++) {
+   omapfb_set_par(fbdev->fbs[i]);
+   }
+   }
+   return 0;
+}
+#else
+#define omapfb_suspend NULL
+#define omapfb_resume  NULL
+#endif
+
+static const struct dev_pm_ops omapfb_pm_ops = {
+   .suspend= omapfb_suspend,
+   .resume = omapfb_resume,
+   .poweroff   = omapfb_suspend,
+   .restore= omapfb_resume,
+};
+
 static int omapfb_probe(struct platform_device *pdev)
 {
struct omapfb2_device *fbdev = NULL;
@@ -2440,6 +2472,7 @@ static struct platform_driver omapfb_driver = {
.driver = {
.name   = "omapfb",
.owner  = THIS_MODULE,
+   .pm = &omapfb_pm_ops,
},
 };
 
-- 
1.7.5.3


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Likely gcc-linaro-4.5-2011.05 misoptimization in libgui (Android)

2011-06-09 Thread Zach Pfeffer
Ken,

Awesome results. Would you mind if I assign the BP to you for this?
Also, it sounds like we have something that we could put into the
build system.

As far as prelink, would you mind posting these issues to
android-build...@googlegroups.com?

-Zach

On 9 June 2011 11:08, Ken Werner  wrote:
> On 05/27/2011 01:20 PM, Alexander Sack wrote:
>>
>> Hi Jim,
>>
>> On Fri, May 27, 2011 at 1:06 PM, Jim Huang  wrote:
>>>
>>> Hello list,
>>>
>>> If you build Android using gcc-linaro-4.5-2011.05 [1], you will
>>> encounter a problem that bootanimation shows endless.  It results from
>>> the mis-optimization in libgui, which handles the operations in
>>> Android SensorManager.
>>>
>>> To work around this problem, you can apply the following patch:
>>>
>>> --- a/libs/gui/Android.mk
>>> +++ b/libs/gui/Android.mk
>>> @@ -18,6 +18,8 @@ LOCAL_SHARED_LIBRARIES := \
>>>
>>>  LOCAL_MODULE:= libgui
>>>
>>> +LOCAL_CFLAGS += -O0
>>> +
>>
>> in channel you said that -O1 is also working ... do we need O0 here?
>>
>> one idea would be to make a list of all optimizations that come for O2
>> and then spin builds with adding one at a time ... in that way we can
>> narrow down things. Not sure if that would be helpful for fixing the
>> issue.
>
> Hi there,
>
> I've got an android build system up and running and had a quick look into
> this. When using the gcc-linaro-4.5-2011.05-0 the bootanimation runs forever
> when compiling the libgui.so using -O[s|1|2]. For me it only works when
> disabling all optizations (-O0). So, I've started with -O0 and tried to
> bisect the various  optimization switches but I didn't fail. Next I've
> started with -O1 and disabled all the optimizations but it didn't pass. So,
> this approach was a dead end. Then I realized that the build system employs
> some sort of a prelinker called apriori. Adding 'LOCAL_PRELINK_MODULE :=
> false' to the makefile disables the prelink step. And the resulting ELF
> binary finally worked (tested with -O[s|1|2]). It would be good to
> understand the root cause of this because the workaround probably has
> drawbacks at run (load) time. Apriori gets two input files. The
> prelink-linux-arm.map which lists the start of the prelink addresses:
>  libui.so                0xAB90 # [~1M]
>  libgui.so               0xAB80 # [~1M]
>  libskia.so              0xAB10 # [~2M]
> and the libgui.so to be prelinked. I'd expect to see the resulting
> PhysAddr's somewhere nearby 0xAB80 but this doesn't seem to be the case
> somehow. In order to exclude a miscompiled apriori, I've prelinked libgui
> using an apriori binary build with the prebuilt gcc44 - no difference.
> Therefore I don't think gcc is miscompiling but something went wrong whith
> the prelink step. But still - the android prelinking remains a mystery to me
> as I don't know what is supposed to be prelinked and what is actually
> failing. However, I think we are one step further.
>
> Regards
> Ken
>
> ___
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>
>

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Likely gcc-linaro-4.5-2011.05 misoptimization in libgui (Android)

2011-06-09 Thread Jim Huang
On 10 June 2011 00:08, Ken Werner  wrote:
> Hi there,
>
> I've got an android build system up and running and had a quick look into
> this. When using the gcc-linaro-4.5-2011.05-0 the bootanimation runs forever
> when compiling the libgui.so using -O[s|1|2]. For me it only works when
> disabling all optimizations (-O0). So, I've started with -O0 and tried to
> bisect the various  optimization switches but I didn't fail. Next I've
> started with -O1 and disabled all the optimizations but it didn't pass. So,
> this approach was a dead end. Then I realized that the build system employs
> some sort of a prelinker called apriori. Adding 'LOCAL_PRELINK_MODULE :=
> false' to the makefile disables the prelink step. And the resulting ELF
> binary finally worked (tested with -O[s|1|2]).

hi Ken,

Thanks for your progress in advance.

Disabling prelinking looks fine, and actually SensorService in
"master" branch disables prelinking as well:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=services/sensorservice/Android.mk;hb=HEAD

The library libsensorservice is highly related to SensorService, which
is activated by SystemServer, an essential process to bring up Android
framework functionality.

In directory frameworks/base/services, libsensorservice is the only
library which is attributed as non-prelinked.

> It would be good to understand the root cause of this because the workaround
> probably has drawbacks at run (load) time. Apriori gets two input files. The
> prelink-linux-arm.map which lists the start of the prelink addresses:
>  libui.so                0xAB90 # [~1M]
>  libgui.so               0xAB80 # [~1M]
>  libskia.so              0xAB10 # [~2M]
> and the libgui.so to be prelinked. I'd expect to see the resulting
> PhysAddr's somewhere nearby 0xAB80 but this doesn't seem to be the case
> somehow. In order to exclude a miscompiled apriori, I've prelinked libgui
> using an apriori binary build with the prebuilt gcc44 - no difference.
> Therefore I don't think gcc is miscompiling but something went wrong whith
> the prelink step. But still - the android prelinking remains a mystery to me
> as I don't know what is supposed to be prelinked and what is actually
> failing. However, I think we are one step further.

So, can you verify the behavior difference between prelink maps as well?

Cheers,
-jserv

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: does anybody have the kernel ddeb for the 1105 omap release hwpack?

2011-06-09 Thread James Westby
On Thu, 9 Jun 2011 11:24:38 +0100, Peter Maydell  
wrote:
> I'm looking for a copy of the ddeb (ie the debug info) for the omap
> kernel in the 1105 release. That used to be here:
> 
> http://ddebs.ubuntu.com/pool/universe/l/linux-linaro-omap/linux-image-2.6.38-1003-linaro-omap-dbgsym_2.6.38-1003.4~ppa5_armel.ddeb
> 
> but unfortunately the archive expired it last night.
> 
> Does anybody happen to have a copy lying around that they could
> send me?

Not me.

> (Also can we sort this out so we stop expiring the ddebs,
> at least for our release kernels?)

I wasn't even aware that our kernel ppa builds ddebs (or even could).

We can't easily fix the expiry, sorry.

The Launchpad team have this in there queue to implement properly, so it
will be go to, but not soon.

I suggest that you grab them frequently if you want them.

Thanks,

James

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


abrek -> lava-test

2011-06-09 Thread Paul Larson
As you may have noticed in a recent email thread, the validation team is in
the process of making some structural changes to the LAVA project.  For
finding all the projects for Linaro Validation that we are working on, the
easiest option is to go to the main LAVA project group page [1] on
Launchpad, which links to each of them.

The last project name change should happen today, and that will be the
rename of abrek to lava-test.  What this means, is that if you currently
pull abrek for use in any other test framework, it will need to be fixed to
pull lp:lava-test instead.  We will make sure this change is reflected in
lava-dispatcher so that there are no interruptions in daily tests that are
running in the validation farm.  However, if you are running your own
dispatcher you will want to update your installation with the update, which
should land in the next 24 hours once the rename of abrek is complete.

Thanks,
Paul Larson

[1] http://launchpad.net/lava
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


linaro packaged 2.6.39 kernel work in progress

2011-06-09 Thread John Rigby
There is a packaged kernel work in progress here:
http://git.linaro.org/gitweb?p=ubuntu/linux-linaro-oneiric.git;a=summary
git://git.linaro.org/ubuntu/linux-linaro-oneiric.git

It is based on a snapshot of linux-linaro-2.6.39 from today plus sauce
and packaging from Ubuntu-2.6.39-3.10.

The bad news is that this kernel does not even boot for me.  As I
chase that down I would like feedback on the new configs.  They are
dramatically reduced compared to the last cycle.  I created the new
configs by starting with the upstream defconfigs for each soc and then
added only what was necessary to satisfy the Ubuntu config enforce
script.

This is the perfect time in the release process to start over with
minimal configs since we have time deal with missing options.  So
please look at the configs and let me know what else should be turned
on.

The packaged kernel has configs split across multiple files.  Which is
a little confusing.  Here is a synopsis:

./debian_linaro/config/config.common.ubuntu is the part that is common
across all arch's and flavours (socs).
./debian_linaro/config/armel/config.common.armel has stuff common
across all armel flavours but since we only have armel then this file
is empty with all the common stuff propagating up to
config.common.ubuntu.
./debian/linaro/config/armel/config.flavour.linaro-* contain the soc
specific stuff.

Any input appreciated.  One obvious thing I have noticed is that the
soc specific options differ in non-soc specific ways that could be
made consistent.  For example lots of CONFIG_CRYPTO options are not
set in mx51 but m or y in omap.  As you see these please give your
opinion on if all plats should make an these y, m or n.

Thanks,
John

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 05/11] PMIC: Add LED Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 led driver from Dialog.
Modify Kconfig/Makefile for DA9052 led driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/leds/Kconfig   |   10 ++
 drivers/leds/Makefile  |1 +
 drivers/leds/leds-da9052.c |  308 
 3 files changed, 319 insertions(+), 0 deletions(-)
 create mode 100644 drivers/leds/leds-da9052.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 23f0d5e..e92dfc1 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -469,4 +469,14 @@ config LEDS_TRIGGER_DEFAULT_ON
 comment "iptables trigger is under Netfilter config (LED target)"
depends on LEDS_TRIGGERS
 
+config LEDS_DA9052
+   tristate "Dialog DA9052 LEDS"
+   depends on PMIC_DIALOG
+   select LEDS_CLASS
+   help
+ This option enables support for on-chip LED drivers found
+ on Dialog Semiconductor DA9052 PMICs.
+
+comment "LED Triggers"
+
 endif # NEW_LEDS
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index bbfd2e3..f29faa0 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_LEDS_MC13783)+= leds-mc13783.o
 obj-$(CONFIG_LEDS_NS2) += leds-ns2.o
 obj-$(CONFIG_LEDS_NETXBIG) += leds-netxbig.o
 obj-$(CONFIG_LEDS_ASIC3)   += leds-asic3.o
+obj-$(CONFIG_LEDS_DA9052)  += leds-da9052.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)  += leds-dac124s085.o
diff --git a/drivers/leds/leds-da9052.c b/drivers/leds/leds-da9052.c
new file mode 100644
index 000..f829a0e
--- /dev/null
+++ b/drivers/leds/leds-da9052.c
@@ -0,0 +1,308 @@
+/*
+ * leds-da9052.c  --  LED Driver for Dialog DA9052
+ *
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * Author: Dialog Semiconductor Ltd 
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define DRIVER_NAME"da9052-leds"
+
+#define DA9052_LED4_PRESENT1
+#define DA9052_LED5_PRESENT1
+
+
+struct da9052_led_data {
+   struct led_classdev cdev;
+   struct work_struct work;
+   struct da9052 *da9052;
+   int id;
+   int new_brightness;
+   int is_led4_present;
+   int is_led5_present;
+};
+
+#define GPIO14_PIN 2 /* GPO Open Drain */
+#define GPIO14_TYPE0 /* VDD_IO1 */
+#define GPIO14_MODE1 /* Output High */
+
+#define GPIO15_PIN 2 /* GPO Open Drain */
+#define GPIO15_TYPE0 /* VDD_IO1 */
+#define GPIO15_MODE1 /* Output High */
+
+#define MAXIMUM_PWM95
+#define MASK_GPIO140x0F
+#define MASK_GPIO150xF0
+#define GPIO15_PIN_BIT_POSITION4
+
+static void da9052_led_work(struct work_struct *work)
+{
+   struct da9052_led_data *led = container_of(work,
+struct da9052_led_data, work);
+   int reg = 0;
+   int led_dim_bit = 0;
+   struct da9052_ssc_msg msg;
+   int ret = 0;
+
+   switch (led->id) {
+   case DA9052_LED_4:
+   reg = DA9052_LED4CONT_REG;
+   led_dim_bit = DA9052_LED4CONT_LED4DIM;
+   break;
+   case DA9052_LED_5:
+   reg = DA9052_LED5CONT_REG;
+   led_dim_bit = DA9052_LED5CONT_LED5DIM;
+   break;
+   }
+
+   if (led->new_brightness > MAXIMUM_PWM)
+   led->new_brightness = MAXIMUM_PWM;
+
+   /* Always enable DIM feature
+* This feature can be disabled if required
+*/
+   msg.addr = reg;
+   msg.data = led->new_brightness | led_dim_bit;
+   da9052_lock(led->da9052);
+   ret = led->da9052->write(led->da9052, &msg);
+   if (ret) {
+   da9052_unlock(led->da9052);
+   return;
+   }
+   da9052_unlock(led->da9052);
+}
+
+static void da9052_led_set(struct led_classdev *led_cdev,
+  enum led_brightness value)
+{
+   struct da9052_led_data *led;
+
+   led = container_of(led_cdev, struct da9052_led_data, cdev);
+   led->new_brightness = value;
+   schedule_work(&led->work);
+}
+
+static int __devinit da9052_led_setup(struct da9052_led_data *led)
+{
+   int reg = 0;
+   int ret = 0;
+
+   struct da9052_ssc_msg msg;
+
+   switch (led->id) {
+   case DA9052_LED_4:
+   reg = DA9052_LED4CONT_REG;
+   break;
+   case DA9052_LED_5:
+   reg = DA9052_LED5CONT_REG;
+   break;
+   }
+
+   msg.addr = reg;
+   msg.data = 0;
+
+   da9052_lock(led->da9052);
+   ret = led->da9052->

[PATCH 00/11] RFC: DA9053 PMIC driver

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Hi. I'm trying to push DA9053 PMIC driver to mainline kernel.
Please help me to review these patches.
Many Thanks.

Ying-Chun Liu (PaulLiu) (11):
  PMIC: Add DA9053 headers from Dialog
  PMIC: Add GPIO Driver for Dialog DA9052
  PMIC: Add ADC Driver for Dialog DA9052
  PMIC: Add TSI/misc input Driver for Dialog DA9052
  PMIC: Add LED Driver for Dialog DA9052
  PMIC: Add MFD Driver for Dialog DA9052
  PMIC: Add BATTERY Driver for Dialog DA9052
  PMIC: Add REGULATOR Driver for Dialog DA9052
  PMIC: Add RTC Driver for Dialog DA9052
  PMIC: Add Video Backlight Driver for Dialog DA9052
  PMIC: Add Watchdog Driver for Dialog DA9052

 drivers/gpio/Kconfig |7 +
 drivers/gpio/Makefile|1 +
 drivers/gpio/da9052-gpio.c   |  731 +++
 drivers/hwmon/Kconfig|   10 +
 drivers/hwmon/Makefile   |1 +
 drivers/hwmon/da9052-adc.c   |  644 ++
 drivers/input/misc/Kconfig   |   10 +
 drivers/input/misc/Makefile  |1 +
 drivers/input/misc/da9052_onkey.c|  133 ++
 drivers/input/touchscreen/Kconfig|7 +
 drivers/input/touchscreen/Makefile   |2 +
 drivers/input/touchscreen/da9052_tsi.c   | 1446 ++
 drivers/input/touchscreen/da9052_tsi_calibrate.c |  107 ++
 drivers/input/touchscreen/da9052_tsi_filter.c|  489 
 drivers/leds/Kconfig |   10 +
 drivers/leds/Makefile|1 +
 drivers/leds/leds-da9052.c   |  308 +
 drivers/mfd/Kconfig  |   37 +
 drivers/mfd/Makefile |2 +
 drivers/mfd/da9052-core.c|  536 
 drivers/mfd/da9052-i2c.c |  378 ++
 drivers/mfd/da9052-spi.c |  402 ++
 drivers/power/Kconfig|7 +
 drivers/power/Makefile   |1 +
 drivers/power/da9052-battery.c   |  847 +
 drivers/regulator/Kconfig|7 +
 drivers/regulator/Makefile   |2 +
 drivers/regulator/da9052-regulator.c |  490 
 drivers/rtc/Kconfig  |7 +
 drivers/rtc/Makefile |1 +
 drivers/rtc/rtc-da9052.c |  694 +++
 drivers/video/backlight/Kconfig  |6 +
 drivers/video/backlight/Makefile |2 +-
 drivers/video/backlight/da9052_bl.c  |  461 +++
 drivers/watchdog/Kconfig |5 +
 drivers/watchdog/Makefile|1 +
 drivers/watchdog/da9052_wdt.c|  542 
 include/linux/mfd/da9052/adc.h   |   66 +
 include/linux/mfd/da9052/bat.h   |  264 
 include/linux/mfd/da9052/bl.h|  289 +
 include/linux/mfd/da9052/da9052.h|  209 
 include/linux/mfd/da9052/eh.h|   77 ++
 include/linux/mfd/da9052/gpio.h  |  253 
 include/linux/mfd/da9052/led.h   |   39 +
 include/linux/mfd/da9052/pm.h|   81 ++
 include/linux/mfd/da9052/reg.h   |  929 ++
 include/linux/mfd/da9052/rtc.h   |  322 +
 include/linux/mfd/da9052/tsi.h   |  427 +++
 include/linux/mfd/da9052/tsi_calibrate.h |   47 +
 include/linux/mfd/da9052/tsi_cfg.h   |  132 ++
 include/linux/mfd/da9052/tsi_filter.h|   58 +
 include/linux/mfd/da9052/wdt.h   |   83 ++
 include/linux/regulator/da9052-regulator.h   |   15 +
 53 files changed, 11626 insertions(+), 1 deletions(-)
 create mode 100644 drivers/gpio/da9052-gpio.c
 create mode 100644 drivers/hwmon/da9052-adc.c
 create mode 100644 drivers/input/misc/da9052_onkey.c
 create mode 100644 drivers/input/touchscreen/da9052_tsi.c
 create mode 100644 drivers/input/touchscreen/da9052_tsi_calibrate.c
 create mode 100644 drivers/input/touchscreen/da9052_tsi_filter.c
 create mode 100644 drivers/leds/leds-da9052.c
 create mode 100644 drivers/mfd/da9052-core.c
 create mode 100644 drivers/mfd/da9052-i2c.c
 create mode 100644 drivers/mfd/da9052-spi.c
 create mode 100644 drivers/power/da9052-battery.c
 create mode 100644 drivers/regulator/da9052-regulator.c
 create mode 100644 drivers/rtc/rtc-da9052.c
 create mode 100644 drivers/video/backlight/da9052_bl.c
 create mode 100644 drivers/watchdog/da9052_wdt.c
 create mode 100644 include/linux/mfd/da9052/adc.h
 create mode 100644 include/linux/mfd/da9052/bat.h
 create mode 100644 include/linux/mfd/da9052/bl.h
 create mode 100644 include/linux/mfd/da9052/da9052.h
 crea

[PATCH 02/11] PMIC: Add GPIO Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 gpio driver from Dialog.
Modify Kconfig/Makefile for DA9052 gpio driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/gpio/Kconfig   |7 +
 drivers/gpio/Makefile  |1 +
 drivers/gpio/da9052-gpio.c |  731 
 3 files changed, 739 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/da9052-gpio.c

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 2967002..ab93c7ab 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -453,4 +453,11 @@ config GPIO_TPS65910
help
  Select this option to enable GPIO driver for the TPS65910
  chip family.
+
+config DA9052_GPIO_ENABLE
+   bool "Dialog DA9052 GPIO"
+   depends on PMIC_DIALOG
+   help
+ Say Y  to enable the GPIO driver for the DA9052 chip
+
 endif
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index b605f8e..cebe1c3 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -48,3 +48,4 @@ obj-$(CONFIG_GPIO_VX855)  += vx855_gpio.o
 obj-$(CONFIG_GPIO_ML_IOH)  += ml_ioh_gpio.o
 obj-$(CONFIG_AB8500_GPIO)   += ab8500-gpio.o
 obj-$(CONFIG_GPIO_TPS65910)+= tps65910-gpio.o
+obj-$(CONFIG_DA9052_GPIO_ENABLE)+= da9052-gpio.o
diff --git a/drivers/gpio/da9052-gpio.c b/drivers/gpio/da9052-gpio.c
new file mode 100644
index 000..a9c53f2
--- /dev/null
+++ b/drivers/gpio/da9052-gpio.c
@@ -0,0 +1,731 @@
+/*
+ * da9052-gpio.c  --  GPIO Driver for Dialog DA9052
+ *
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * Author: Dialog Semiconductor Ltd 
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define DRIVER_NAME "da9052-gpio"
+static inline struct da9052_gpio_chip *to_da9052_gpio(struct gpio_chip *chip)
+{
+   return container_of(chip, struct da9052_gpio_chip, gp);
+}
+
+void da9052_gpio_notifier(struct da9052_eh_nb *eh_data, unsigned int event)
+{
+   struct da9052_gpio_chip *gpio =
+   container_of(eh_data, struct da9052_gpio_chip, eh_data);
+   kobject_uevent(&gpio->gp.dev->kobj, KOBJ_CHANGE);
+   printk(KERN_INFO "Event received from GPIO8\n");
+}
+
+static u8 create_gpio_config_value(u8 gpio_function, u8 gpio_type, u8 
gpio_mode)
+{
+   /* The format is -
+   function - 2 bits
+   type - 1 bit
+   mode - 1 bit */
+   return gpio_function | (gpio_type << 2) | (gpio_mode << 3);
+}
+
+static s32 write_default_gpio_values(struct da9052 *da9052)
+{
+   struct da9052_ssc_msg msg;
+   u8 created_val = 0;
+
+#if (DA9052_GPIO_PIN_0 == DA9052_GPIO_CONFIG)
+   da9052_lock(da9052);
+   msg.addr = DA9052_GPIO0001_REG;
+   msg.data = 0;
+
+   if (da9052->read(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return -EIO;
+   }
+
+   created_val = create_gpio_config_value(DEFAULT_GPIO0_FUNCTION,
+   DEFAULT_GPIO0_TYPE, DEFAULT_GPIO0_MODE);
+   msg.data &= DA9052_GPIO_MASK_UPPER_NIBBLE;
+   msg.data |= created_val;
+
+   if (da9052->write(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return -EIO;
+   }
+   da9052_unlock(da9052);
+#endif
+#if (DA9052_GPIO_PIN_1 == DA9052_GPIO_CONFIG)
+   da9052_lock(da9052);
+   msg.addr = DA9052_GPIO0001_REG;
+   msg.data = 0;
+
+   if (da9052->read(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return -EIO;
+   }
+
+   created_val = create_gpio_config_value(DEFAULT_GPIO1_FUNCTION,
+   DEFAULT_GPIO1_TYPE, DEFAULT_GPIO1_MODE);
+   created_val = created_val << DA9052_GPIO_NIBBLE_SHIFT;
+   msg.data &= DA9052_GPIO_MASK_LOWER_NIBBLE;
+   msg.data |= created_val;
+
+   if (da9052->write(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return -EIO;
+   }
+   da9052_unlock(da9052);
+#endif
+/* GPIO 2-3*/
+#if (DA9052_GPIO_PIN_2 == DA9052_GPIO_CONFIG)
+   da9052_lock(da9052);
+   msg.addr = DA9052_GPIO0203_REG;
+   msg.data = 0;
+
+   if (da9052->read(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return -EIO;
+   }
+
+   created_val = create_gpio_config_value(DEFAULT_GPIO2_FUNCTION,
+   DEFAULT_GPIO2_TYPE, DEFAULT_GPIO2_MODE);
+   msg.data &= DA9052_GPIO_MASK_UPPER_NIBBLE;
+   msg.data |= created_val;
+
+   if (da9052->write(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return -EIO;
+   }
+   da9052_unlock(da9052);
+#endif
+#if 

[PATCH 03/11] PMIC: Add ADC Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 ADC driver from Dialog.
Modify Kconfig/Makefile for DA9052 ADC driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/hwmon/Kconfig  |   10 +
 drivers/hwmon/Makefile |1 +
 drivers/hwmon/da9052-adc.c |  644 
 3 files changed, 655 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hwmon/da9052-adc.c

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 16db83c..ad652dd 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -39,6 +39,16 @@ config HWMON_DEBUG_CHIP
 
 comment "Native drivers"
 
+config SENSORS_DA9052
+   tristate "Dialog DA9052 HWMon"
+   depends on PMIC_DIALOG
+   help
+ Say y here to support the ADC found on Dialog Semiconductor DA9052
+ PMIC.
+
+ This driver can also be built as a module.  If so, the module
+ will be called da9052-adc.
+
 config SENSORS_ABITUGURU
tristate "Abit uGuru (rev 1 & 2)"
depends on X86 && DMI && EXPERIMENTAL
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 28061cf..e640ff8 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -118,6 +118,7 @@ obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o
 obj-$(CONFIG_SENSORS_W83L786NG)+= w83l786ng.o
 obj-$(CONFIG_SENSORS_WM831X)   += wm831x-hwmon.o
 obj-$(CONFIG_SENSORS_WM8350)   += wm8350-hwmon.o
+obj-$(CONFIG_SENSORS_DA9052)   += da9052-adc.o
 
 # PMBus drivers
 obj-$(CONFIG_PMBUS)+= pmbus_core.o
diff --git a/drivers/hwmon/da9052-adc.c b/drivers/hwmon/da9052-adc.c
new file mode 100644
index 000..57985c2
--- /dev/null
+++ b/drivers/hwmon/da9052-adc.c
@@ -0,0 +1,644 @@
+/*
+ * da9052-adc.c  --  ADC Driver for Dialog DA9052
+ *
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * Author: Dialog Semiconductor Ltd 
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DRIVER_NAME "da9052-adc"
+
+static const char * const input_names[] = {
+   [DA9052_ADC_VDDOUT] =   "VDDOUT",
+   [DA9052_ADC_ICH]=   "CHARGING CURRENT",
+   [DA9052_ADC_TBAT]   =   "BATTERY TEMP",
+   [DA9052_ADC_VBAT]   =   "BATTERY VOLTAGE",
+   [DA9052_ADC_ADCIN4] =   "ADC INPUT 4",
+   [DA9052_ADC_ADCIN5] =   "ADC INPUT 5",
+   [DA9052_ADC_ADCIN6] =   "ADC INPUT 6",
+   [DA9052_ADC_TSI]=   "TSI",
+   [DA9052_ADC_TJUNC]  =   "BATTERY JUNCTION TEMP",
+   [DA9052_ADC_VBBAT]  =   "BACK-UP BATTERY TEMP",
+};
+
+
+int da9052_manual_read(struct da9052 *da9052,
+   unsigned char channel)
+{
+   unsigned char man_timeout_cnt = DA9052_ADC_MAX_MANCONV_RETRY_COUNT;
+   struct da9052_ssc_msg msg;
+   unsigned short calc_data;
+   unsigned int ret;
+   u16 data = 0;
+
+   msg.addr = DA9052_ADCMAN_REG;
+   msg.data = channel;
+   msg.data =  (msg.data | DA9052_ADCMAN_MANCONV);
+
+   mutex_lock(&da9052->manconv_lock);
+   da9052_lock(da9052);
+
+   ret = da9052->write(da9052, &msg);
+   if (ret)
+   goto err_ssc_comm;
+   da9052_unlock(da9052);
+
+   /* Wait for the event */
+   do {
+   msg.addr = DA9052_ADCCONT_REG;
+   msg.data = 0;
+   da9052_lock(da9052);
+   ret = da9052->read(da9052, &msg);
+   if (ret)
+   goto err_ssc_comm;
+   da9052_unlock(da9052);
+
+   if (DA9052_ADCCONT_ADCMODE & msg.data)
+   msleep(1);
+   else
+   msleep(10);
+
+   msg.addr = DA9052_ADCMAN_REG;
+   msg.data = 0;
+   da9052_lock(da9052);
+   ret = da9052->read(da9052, &msg);
+   if (ret)
+   goto err_ssc_comm;
+   da9052_unlock(da9052);
+
+   /* Counter to avoid endless while loop */
+   man_timeout_cnt--;
+   if (man_timeout_cnt == 1) {
+   if (!(msg.data & DA9052_ADCMAN_MANCONV))
+   break;
+   else
+   goto err_ssc_comm;
+   }
+   /* Wait until the MAN_CONV bit is cleared to zero */
+   } while (msg.data & DA9052_ADCMAN_MANCONV);
+
+   msg.addr = DA9052_ADCRESH_REG;
+   msg.data = 0;
+
+   da9052_lock(da9052);
+   ret = da9052->read(da9052, &msg);
+   if (ret)
+   goto err_ssc_comm;
+  

[PATCH 06/11] PMIC: Add MFD Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 mfd driver from Dialog.
Modify Kconfig/Makefile for DA9052 mfd driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/mfd/Kconfig   |   37 +++
 drivers/mfd/Makefile  |2 +
 drivers/mfd/da9052-core.c |  536 +
 drivers/mfd/da9052-i2c.c  |  378 
 drivers/mfd/da9052-spi.c  |  402 +
 5 files changed, 1355 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/da9052-core.c
 create mode 100644 drivers/mfd/da9052-i2c.c
 create mode 100644 drivers/mfd/da9052-spi.c

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0f09c05..a3d0568 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -483,6 +483,43 @@ config PCF50633_GPIO
 Say yes here if you want to include support GPIO for pins on
 the PCF50633 chip.
 
+config PMIC_DIALOG
+   bool "Support Dialog Semiconductor PMIC"
+   depends on I2C=y
+   depends on SPI=y
+   select MFD_CORE
+   help
+   Support for Dialog semiconductor PMIC chips.
+   Use the options provided to support the desired PMIC's.
+choice
+   prompt "Chip Type"
+   depends on PMIC_DIALOG
+config PMIC_DA9052
+   bool "Support Dialog Semiconductor DA9052 PMIC"
+   help
+   Support for Dialog semiconductor DA9052 PMIC with inbuilt
+   SPI & I2C connectivities.
+   This driver provides common support for accessing  the device,
+   additional drivers must be enabled in order to use the
+   functionality of the device.
+config PMIC_DA9053AA
+   bool "Support Dialog Semiconductor DA9053 AA PMIC"
+   help
+   Support for Dialog semiconductor DA9053 AA PMIC with inbuilt
+   SPI & I2C connectivities.
+   This driver provides common support for accessing  the device,
+   additional drivers must be enabled in order to use the
+   functionality of the device.
+config PMIC_DA9053Bx
+   bool "Support Dialog Semiconductor DA9053 BA/BB PMIC"
+   help
+   Support for Dialog semiconductor DA9053 BA/BB PMIC with inbuilt
+   SPI & I2C connectivities.
+   This driver provides common support for accessing  the device,
+   additional drivers must be enabled in order to use the
+   functionality of the device.
+endchoice
+
 config MFD_MC13783
tristate
 
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index efe3cc3..d30b69c 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -94,3 +94,5 @@ obj-$(CONFIG_MFD_OMAP_USB_HOST)   += omap-usb-host.o
 obj-$(CONFIG_MFD_PM8921_CORE)  += pm8921-core.o
 obj-$(CONFIG_MFD_PM8XXX_IRQ)   += pm8xxx-irq.o
 obj-$(CONFIG_MFD_TPS65910) += tps65910.o tps65910-irq.o
+da9052-objs:= da9052-spi.o da9052-i2c.o da9052-core.o
+obj-$(CONFIG_PMIC_DIALOG)  += da9052.o
diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c
new file mode 100644
index 000..002cf50
--- /dev/null
+++ b/drivers/mfd/da9052-core.c
@@ -0,0 +1,536 @@
+/*
+ * da9052-core.c  --  Device access for Dialog DA9052
+ *
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * Author: Dialog Semiconductor Ltd 
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define SUCCESS0
+#define FAILURE1
+
+struct da9052_eh_nb eve_nb_array[EVE_CNT];
+static struct da9052_ssc_ops ssc_ops;
+struct mutex manconv_lock;
+static struct semaphore eve_nb_array_lock;
+
+void da9052_lock(struct da9052 *da9052)
+{
+   mutex_lock(&da9052->ssc_lock);
+}
+EXPORT_SYMBOL(da9052_lock);
+
+void da9052_unlock(struct da9052 *da9052)
+{
+   mutex_unlock(&da9052->ssc_lock);
+}
+EXPORT_SYMBOL(da9052_unlock);
+
+int da9052_ssc_write(struct da9052 *da9052, struct da9052_ssc_msg *sscmsg)
+{
+   int ret = 0;
+
+   /* Reg address should be a valid address on PAGE0 or PAGE1 */
+   if ((sscmsg->addr < DA9052_PAGE0_REG_START) ||
+   (sscmsg->addr > DA9052_PAGE1_REG_END) ||
+   ((sscmsg->addr > DA9052_PAGE0_REG_END) &&
+   (sscmsg->addr < DA9052_PAGE1_REG_START)))
+   return INVALID_REGISTER;
+
+   ret = ssc_ops.write(da9052, sscmsg);
+
+   /* Update local cache if required */
+   if (!ret) {
+   /* Check if this register is Non-volatile*/
+   if (da9052->ssc_cache[sscmsg->addr].type != VOLATILE) {
+   /* Update value */
+   da9052->ssc_cache[sscmsg->addr].val = sscmsg->data;
+   /* Make this ca

[PATCH 10/11] PMIC: Add Video Backlight Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 video backlight driver from Dialog.
Modify Kconfig/Makefile for DA9052 video backlight driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/video/backlight/Kconfig |6 +
 drivers/video/backlight/Makefile|2 +-
 drivers/video/backlight/da9052_bl.c |  461 +++
 3 files changed, 468 insertions(+), 1 deletions(-)
 create mode 100644 drivers/video/backlight/da9052_bl.c

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 0c9373b..a233749 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -315,6 +315,12 @@ config BACKLIGHT_PCF50633
  If you have a backlight driven by a NXP PCF50633 MFD, say Y here to
  enable its driver.
 
+config BACKLIGHT_DA9052
+   tristate "Dialog DA9052 WLED"
+   depends on PMIC_DIALOG
+   help
+ Enable the DA9052 Backlight Driver
+
 endif # BACKLIGHT_CLASS_DEVICE
 
 endif # BACKLIGHT_LCD_SUPPORT
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index b9ca849..0c8334f 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -36,4 +36,4 @@ obj-$(CONFIG_BACKLIGHT_ADP5520)   += adp5520_bl.o
 obj-$(CONFIG_BACKLIGHT_ADP8860)+= adp8860_bl.o
 obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o
 obj-$(CONFIG_BACKLIGHT_PCF50633)   += pcf50633-backlight.o
-
+obj-$(CONFIG_BACKLIGHT_DA9052) += da9052_bl.o
diff --git a/drivers/video/backlight/da9052_bl.c 
b/drivers/video/backlight/da9052_bl.c
new file mode 100644
index 000..0692194
--- /dev/null
+++ b/drivers/video/backlight/da9052_bl.c
@@ -0,0 +1,461 @@
+/*
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * da9052_bl.c: Backlight driver for DA9052
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+
+#define DRIVER_NAME"da9052-backlight"
+#define DRIVER_NAME1   "WLED-1"
+#define DRIVER_NAME2   "WLED-2"
+#define DRIVER_NAME3   "WLED-3"
+
+/* These flags define if Backlight LEDs are present */
+/* Set the following macros to 1, if LEDs are present. Otherwise set to 0 */
+#define DA9052_LED1_PRESENT1
+#define DA9052_LED2_PRESENT1
+#define DA9052_LED3_PRESENT1
+
+#define DA9052_MAX_BRIGHTNESS  0xFF
+
+struct da9052_backlight_data {
+   struct device *da9052_dev;
+   int current_brightness;
+   struct da9052 *da9052;
+
+   int is_led1_present;
+   int is_led2_present;
+   int is_led3_present;
+};
+
+enum da9052_led_number {
+   LED1 = 1,
+   LED2,
+   LED3,
+};
+
+static int da9052_backlight_brightness_set(struct da9052_backlight_data *data,
+   int brightness, enum da9052_led_number led)
+{
+   /*
+* Mechanism for brightness control:
+* For brightness control, current is used.
+* PWM feature is not used.
+* To use PWM feature, a fixed value of current should be defined.
+*/
+
+   int ret = 0;
+   unsigned int led_ramp_bit;
+   unsigned int led_current_register;
+   unsigned int led_current_sink_bit;
+   unsigned int led_boost_en_bit;
+   struct da9052_ssc_msg msg;
+
+   switch (led) {
+   case LED1:
+   led_ramp_bit = DA9052_LEDCONT_LED1RAMP;
+   led_current_register = DA9052_LED1CONF_REG;
+   led_current_sink_bit = DA9052_LEDCONT_LED1EN;
+   led_boost_en_bit = DA9052_BOOST_LED1INEN;
+   break;
+   case LED2:
+   led_ramp_bit = DA9052_LEDCONT_LED2RAMP;
+   led_current_register = DA9052_LED2CONF_REG;
+   led_current_sink_bit = DA9052_LEDCONT_LED2EN;
+   led_boost_en_bit = DA9052_BOOST_LED2INEN;
+   break;
+   case LED3:
+   led_ramp_bit = DA9052_LEDCONT_LED3RAMP;
+   led_current_register = DA9052_LED3CONF_REG;
+   led_current_sink_bit = DA9052_LEDCONT_LED3EN;
+   led_boost_en_bit = DA9052_BOOST_LED3INEN;
+   break;
+   default:
+   return -EIO;
+   }
+
+   /*
+   1. Configure the boost register
+   2. Configure the LED _CONT register
+   3. Configure the LEDx_CONF registers to the brightness value.
+   */
+   msg.addr = DA9052_BOOST_REG;
+   msg.data = 0x3F;
+   if (brightness) {
+   da9052_lock(data->da9052);
+   ret = data->da9052->write(data->da9052, &msg);
+   if (ret) {
+   da9052_unlock(data->da9052);
+   return ret;
+   }
+

[PATCH 09/11] PMIC: Add RTC Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 rtc driver from Dialog.
Modify Kconfig/Makefile for DA9052 rtc driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/rtc/Kconfig  |7 +
 drivers/rtc/Makefile |1 +
 drivers/rtc/rtc-da9052.c |  694 ++
 3 files changed, 702 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/rtc-da9052.c

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index f822e13..58515a2 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1051,4 +1051,11 @@ config RTC_DRV_TILE
  Enable support for the Linux driver side of the Tilera
  hypervisor's real-time clock interface.
 
+config RTC_DRV_DA9052
+   tristate "Dialog DA9052 RTC"
+   depends on PMIC_DIALOG
+   help
+ Say y here to support the RTC found on
+ Dialog Semiconductor DA9052 PMIC.
+
 endif # RTC_CLASS
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 213d725..20c8b27 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -107,3 +107,4 @@ obj-$(CONFIG_RTC_DRV_VT8500)+= rtc-vt8500.o
 obj-$(CONFIG_RTC_DRV_WM831X)   += rtc-wm831x.o
 obj-$(CONFIG_RTC_DRV_WM8350)   += rtc-wm8350.o
 obj-$(CONFIG_RTC_DRV_X1205)+= rtc-x1205.o
+obj-$(CONFIG_RTC_DRV_DA9052)   += rtc-da9052.o
diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
new file mode 100644
index 000..17ca177
--- /dev/null
+++ b/drivers/rtc/rtc-da9052.c
@@ -0,0 +1,694 @@
+/*
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * rtc-da9052.c: RTC driver for DA9052
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DRIVER_NAME "da9052-rtc"
+#define ENABLE 1
+#define DISABLE0
+
+struct da9052_rtc {
+   struct rtc_device *rtc;
+   struct da9052 *da9052;
+   struct da9052_eh_nb eh_data;
+   unsigned char is_min_alarm;
+   unsigned char enable_tick_alarm;
+   unsigned char enable_clk_buffer;
+   unsigned char set_osc_trim_freq;
+};
+
+static int da9052_rtc_enable_alarm(struct da9052 *da9052, unsigned char flag);
+
+void da9052_rtc_notifier(struct da9052_eh_nb *eh_data, unsigned int event)
+{
+   struct da9052_rtc *rtc =
+   container_of(eh_data, struct da9052_rtc, eh_data);
+   struct da9052_ssc_msg msg;
+   unsigned int ret;
+
+   /* Check the alarm type - TIMER or TICK */
+   msg.addr = DA9052_ALARMMI_REG;
+
+   da9052_lock(rtc->da9052);
+   ret = rtc->da9052->read(rtc->da9052, &msg);
+   if (ret != 0) {
+   da9052_unlock(rtc->da9052);
+   return;
+   }
+
+   da9052_unlock(rtc->da9052);
+
+
+   if (msg.data & DA9052_ALARMMI_ALARMTYPE) {
+   da9052_rtc_enable_alarm(rtc->da9052, 0);
+   printk(KERN_INFO "RTC: TIMER ALARM\n");
+   } else {
+   kobject_uevent(&rtc->rtc->dev.kobj, KOBJ_CHANGE);
+   printk(KERN_INFO "RTC: TICK ALARM\n");
+   }
+}
+
+static int da9052_rtc_validate_parameters(struct rtc_time *rtc_tm)
+{
+
+   if (rtc_tm->tm_sec > DA9052_RTC_SECONDS_LIMIT)
+   return DA9052_RTC_INVALID_SECONDS;
+
+   if (rtc_tm->tm_min > DA9052_RTC_MINUTES_LIMIT)
+   return DA9052_RTC_INVALID_MINUTES;
+
+   if (rtc_tm->tm_hour > DA9052_RTC_HOURS_LIMIT)
+   return DA9052_RTC_INVALID_HOURS;
+
+   if (rtc_tm->tm_mday == 0)
+   return DA9052_RTC_INVALID_DAYS;
+
+   if ((rtc_tm->tm_mon > DA9052_RTC_MONTHS_LIMIT) ||
+   (rtc_tm->tm_mon == 0))
+   return DA9052_RTC_INVALID_MONTHS;
+
+   if (rtc_tm->tm_year > DA9052_RTC_YEARS_LIMIT)
+   return DA9052_RTC_INVALID_YEARS;
+
+   if ((rtc_tm->tm_mon == FEBRUARY)) {
+   if (((rtc_tm->tm_year % 4 == 0) &&
+   (rtc_tm->tm_year % 100 != 0)) ||
+   (rtc_tm->tm_year % 400 == 0)) {
+   if (rtc_tm->tm_mday > 29)
+   return DA9052_RTC_INVALID_DAYS;
+   } else if (rtc_tm->tm_mday > 28) {
+   return DA9052_RTC_INVALID_DAYS;
+   }
+   }
+
+   if (((rtc_tm->tm_mon == APRIL) || (rtc_tm->tm_mon == JUNE) ||
+   (rtc_tm->tm_mon == SEPTEMBER) || (rtc_tm->tm_mon == NOVEMBER))
+   && (rtc_tm->tm_mday == 31)) {
+   return DA9052_RTC_INVALID_DAYS;
+   }
+
+
+   return 0;
+}
+
+static int da9052_rtc_settime(struct da9052 *da9052, struct rtc_time *rtc_tm)
+{
+
+   struct da9052_ssc_msg msg_arr[6];
+   int validate_param = 0;
+   unsigned char loop_index = 0;
+   int ret = 0;
+
+

[PATCH 07/11] PMIC: Add BATTERY Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 battery driver from Dialog.
Modify Kconfig/Makefile for DA9052 battery driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/power/Kconfig  |7 +
 drivers/power/Makefile |1 +
 drivers/power/da9052-battery.c |  847 
 3 files changed, 855 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/da9052-battery.c

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index e57b50b..8145ff8 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -235,4 +235,11 @@ config CHARGER_GPIO
  This driver can be build as a module. If so, the module will be
  called gpio-charger.
 
+config BATTERY_DA9052
+   tristate "Dialog DA9052 Battery"
+   depends on PMIC_DIALOG
+   help
+ Say Y here to enable support for batteries charger integrated into
+ DA9052 PMIC.
+
 endif # POWER_SUPPLY
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 009a90f..ad6493a 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -36,3 +36,4 @@ obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
 obj-$(CONFIG_CHARGER_MAX8903)  += max8903_charger.o
 obj-$(CONFIG_CHARGER_TWL4030)  += twl4030_charger.o
 obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o
+obj-$(CONFIG_BATTERY_DA9052)   += da9052-battery.o
diff --git a/drivers/power/da9052-battery.c b/drivers/power/da9052-battery.c
new file mode 100644
index 000..210e8ed
--- /dev/null
+++ b/drivers/power/da9052-battery.c
@@ -0,0 +1,847 @@
+/*
+ * da9052-battery.c  --  Batttery Driver for Dialog DA9052
+ *
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * Author: Dialog Semiconductor Ltd 
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define DA9052_BAT_DEVICE_NAME "da9052-bat"
+
+static const char  __initdata banner[] = KERN_INFO \
+   "DA9052 BAT, (c) 2009 Dialog semiconductor Ltd.\n";
+
+static struct da9052_bat_hysteresis bat_hysteresis;
+static struct da9052_bat_event_registration event_status;
+
+
+static u16 array_hys_batvoltage[2];
+static u16 bat_volt_arr[3];
+static u8 hys_flag = FALSE;
+
+static int da9052_read(struct da9052 *da9052, u8 reg_address, u8 *reg_data)
+{
+   struct da9052_ssc_msg msg;
+   int ret;
+
+   msg.addr = reg_address;
+   msg.data = 0;
+
+   da9052_lock(da9052);
+   ret = da9052->read(da9052, &msg);
+   if (ret)
+   goto ssc_comm_err;
+   da9052_unlock(da9052);
+
+   *reg_data = msg.data;
+   return 0;
+ssc_comm_err:
+   da9052_unlock(da9052);
+   return ret;
+}
+
+static s32 da9052_adc_read_ich(struct da9052 *da9052, u16 *data)
+{
+   struct da9052_ssc_msg msg;
+   da9052_lock(da9052);
+   /* Read charging conversion register */
+   msg.addr = DA9052_ICHGAV_REG;
+   msg.data = 0;
+   if (da9052->read(da9052, &msg)) {
+   da9052_unlock(da9052);
+   return DA9052_SSC_FAIL;
+   }
+   da9052_unlock(da9052);
+
+   *data = (u16)msg.data;
+   DA9052_DEBUG("In function: %s, ICHGAV_REG value read (1)= 0x%X\n",
+   __func__, msg.data);
+   return SUCCESS;
+}
+
+
+static s32 da9052_adc_read_tbat(struct da9052 *da9052, u16 *data)
+{
+   s32 ret;
+   u8 reg_data;
+
+   ret = da9052_read(da9052, DA9052_TBATRES_REG, ®_data);
+   if (ret)
+   return ret;
+   *data = (u16)reg_data;
+
+   DA9052_DEBUG("In function: %s, TBATRES_REG value read (1)= 0x%X\n",
+   __func__, msg.data);
+   return SUCCESS;
+}
+
+s32 da9052_adc_read_vbat(struct da9052 *da9052, u16 *data)
+{
+   s32 ret;
+
+   ret = da9052_manual_read(da9052, DA9052_ADC_VBAT);
+   DA9052_DEBUG("In function: %s, VBAT value read (1)= 0x%X\n",
+   __func__, temp);
+   if (ret == -EIO) {
+   *data = 0;
+   return ret;
+   } else {
+   *data = ret;
+   return 0;
+   }
+   return 0;
+}
+
+
+static u16 filter_sample(u16 *buffer)
+{
+   u8 count;
+   u16 tempvalue = 0;
+   u16 ret;
+
+   if (buffer == NULL)
+   return -EINVAL;
+
+   for (count = 0; count < DA9052_FILTER_SIZE; count++)
+   tempvalue = tempvalue + *(buffer + count);
+
+   ret = tempvalue/DA9052_FILTER_SIZE;
+   return ret;
+}
+
+static s32  da9052_bat_get_battery_temperature(struct da9052_charger_device
+   *chg_device, u16 *buffer)
+{
+
+   u8 count;
+   u16 filterqueue[DA9052_FI

[PATCH 11/11] PMIC: Add Watchdog Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 watchdog driver from Dialog.
Modify Kconfig/Makefile for DA9052 watchdog driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/watchdog/Kconfig  |5 +
 drivers/watchdog/Makefile |1 +
 drivers/watchdog/da9052_wdt.c |  542 +
 3 files changed, 548 insertions(+), 0 deletions(-)
 create mode 100644 drivers/watchdog/da9052_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 022f9eb..f2a8025 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1232,6 +1232,11 @@ config WDTPCI
  To compile this driver as a module, choose M here: the
  module will be called wdt_pci.
 
+config DA9052_WATCHDOG
+   tristate "Dialog DA9052 Watchdog"
+   depends on PMIC_DIALOG
+   help
+ Support for the watchdog in the DA9052 PMIC.
 #
 # USB-based Watchdog Cards
 #
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index ed26f70..fae2cfc 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -159,3 +159,4 @@ obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
 obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
+obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o
diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c
new file mode 100644
index 000..7d0ecd9
--- /dev/null
+++ b/drivers/watchdog/da9052_wdt.c
@@ -0,0 +1,542 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+#include 
+#include 
+#include 
+
+#define DRIVER_NAME "da9052-wdt"
+
+#defineDA9052_STROBING_FILTER_ENABLE   0x0001
+#defineDA9052_STROBING_FILTER_DISABLE  0x0002
+#defineDA9052_SET_STROBING_MODE_MANUAL 0x0004
+#defineDA9052_SET_STROBING_MODE_AUTO   0x0008
+
+#define KERNEL_MODULE  0
+#define ENABLE 1
+#define DISABLE0
+
+static u8 sm_strobe_filter_flag = DISABLE;
+static u8 sm_strobe_mode_flag = DA9052_STROBE_MANUAL;
+static u32 sm_mon_interval = DA9052_ADC_TWDMIN_TIME;
+static u8 sm_str_req = DISABLE;
+static u8 da9052_sm_scale = DA9052_WDT_DISABLE;
+module_param(sm_strobe_filter_flag,  byte, 0);
+MODULE_PARM_DESC(sm_strobe_filter_flag,
+   "DA9052 SM driver strobe filter flag default = DISABLE");
+
+module_param(sm_strobe_mode_flag, byte, 0);
+MODULE_PARM_DESC(sm_strobe_mode_flag,
+   "DA9052 SM driver watchdog strobing mode default"\
+   "= DA9052_STROBE_MANUAL");
+
+module_param(da9052_sm_scale, byte, 0);
+MODULE_PARM_DESC(da9052_sm_scale,
+   "DA9052 SM driver scaling value used to calculate the"\
+   "time for the strobing  filter default = 0");
+
+module_param(sm_str_req, byte, 0);
+MODULE_PARM_DESC(sm_str_req,
+   "DA9052 SM driver strobe request flag default = DISABLE");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout,
+   "Watchdog cannot be stopped once started (default="
+   __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static struct timer_list *monitoring_timer;
+
+struct da9052_wdt {
+   struct platform_device *pdev;
+   struct da9052 *da9052;
+};
+static struct miscdevice da9052_wdt_miscdev;
+static unsigned long da9052_wdt_users;
+static int da9052_wdt_expect_close;
+
+static struct da9052_wdt *get_wdt_da9052(void)
+{
+   /*return dev_get_drvdata(da9052_wdt_miscdev.parent);*/
+   return platform_get_drvdata
+   (to_platform_device(da9052_wdt_miscdev.parent));
+}
+
+void start_strobing(struct work_struct *work)
+{
+   struct da9052_ssc_msg msg;
+   int ret;
+   struct da9052_wdt *wdt = get_wdt_da9052();
+
+
+   if (NULL == wdt) {
+   mod_timer(monitoring_timer, jiffies + sm_mon_interval);
+   return;
+   }
+   msg.addr = DA9052_CONTROLD_REG;
+   msg.data = 0;
+   da9052_lock(wdt->da9052);
+   ret = wdt->da9052->read(wdt->da9052, &msg);
+   if (ret) {
+   da9052_unlock(wdt->da9052);
+   return;
+   }
+   da9052_unlock(wdt->da9052);
+
+   msg.data = (msg.data | DA9052_CONTROLD_WATCHDOG);
+   da9052_lock(wdt->da9052);
+   ret = wdt->da9052->write(wdt->da9052, &msg);
+   if (ret) {
+   da9052_unlock(wdt->da9052);
+   return;
+   }
+   da9052_unlock(wdt->da9052);
+
+   sm_str_req = DISABLE;
+
+   mod_timer(monitoring_timer, jiffies + sm_mon_interval);
+   return;
+}
+
+
+void timer_callback(void)
+{
+   if (((sm_strobe_mode_flag) &&
+   (sm_strobe_mode_flag == DA9052_STROBE_MANUAL)) ||
+ 

[PATCH 08/11] PMIC: Add REGULATOR Driver for Dialog DA9052

2011-06-09 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Add DA9052 regulator driver from Dialog.
Modify Kconfig/Makefile for DA9052 regulator driver.

Signed-off-by: Zhou Jingyu 
Acked-by: Lily Zhang 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
---
 drivers/regulator/Kconfig  |7 +
 drivers/regulator/Makefile |2 +
 drivers/regulator/da9052-regulator.c   |  490 
 include/linux/regulator/da9052-regulator.h |   15 +
 4 files changed, 514 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/da9052-regulator.c
 create mode 100644 include/linux/regulator/da9052-regulator.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index d7ed20f..4ae56ac 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -303,5 +303,12 @@ config REGULATOR_TPS65910
help
  This driver supports TPS65910 voltage regulator chips.
 
+config REGULATOR_DA9052
+   tristate "Dialog DA9052 regulators"
+   depends on PMIC_DIALOG
+   help
+ Say y here to support the BUCKs and LDOs regulators found on
+ Dialog Semiconductor DA9052 PMIC.
+
 endif
 
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 3932d2e..2aa6496 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
 obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o
 obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
+obj-$(CONFIG_REGULATOR_DA9052)  += da9052-regulator.o
 obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
 obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
@@ -43,5 +44,6 @@ obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
 obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
 obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
 obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
+obj-$(CONFIG_REGULATOR_DA9052)  += da9052-regulator.o
 
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/da9052-regulator.c 
b/drivers/regulator/da9052-regulator.c
new file mode 100644
index 000..612fe60
--- /dev/null
+++ b/drivers/regulator/da9052-regulator.c
@@ -0,0 +1,490 @@
+/*
+ * Copyright(c) 2009 Dialog Semiconductor Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * da9052-regulator.c: Regulator driver for DA9052
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static struct regulator_ops da9052_ldo_buck_ops;
+
+
+struct regulator {
+   struct device *dev;
+   struct list_head list;
+   int uA_load;
+   int min_uV;
+   int max_uV;
+   int enabled; /* client has called enabled */
+   char *supply_name;
+   struct device_attribute dev_attr;
+   struct regulator_dev *rdev;
+};
+
+
+
+
+#define DA9052_LDO(_id, max, min, step_v, reg, mbits, cbits) \
+{\
+   .reg_desc   = {\
+   .name   = #_id,\
+   .ops= &da9052_ldo_buck_ops,\
+   .type   = REGULATOR_VOLTAGE,\
+   .id = _id,\
+   .owner  = THIS_MODULE,\
+   },\
+   .reg_const = {\
+   .max_uV = (max) * 1000,\
+   .min_uV = (min) * 1000,\
+   .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE\
+   | REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE,\
+   .valid_modes_mask = REGULATOR_MODE_NORMAL,\
+   },\
+   .step_uV= (step_v) * 1000,\
+   .reg_add= (reg),\
+   .mask_bits  = (mbits),\
+   .en_bit_mask= (cbits),\
+}
+
+struct regulator_info {
+   struct regulator_desc reg_desc;
+   struct regulation_constraints reg_const;
+   int step_uV;
+   unsigned char reg_add;
+   unsigned char mask_bits;
+   unsigned char en_bit_mask;
+};
+
+struct da9052_regulator_priv {
+   struct da9052 *da9052;
+   struct regulator_dev *regulators[];
+};
+
+struct regulator_info da9052_regulators[] = {
+   /* LD01 - LDO10*/
+   DA9052_LDO(DA9052_LDO1, DA9052_LDO1_VOLT_UPPER, DA9052_LDO1_VOLT_LOWER,
+   DA9052_LDO1_VOLT_STEP, DA9052_LDO1_REG,
+   DA9052_LDO1_VLDO1, DA9052_LDO1_LDO1EN),
+
+   DA9052_LDO(DA9052_LDO2,
+   DA9052_LDO2_VOLT_UPPER, DA9052_LDO2_VOLT_LOWER,
+   DA9052_LDO2_VOLT_STEP, DA9052_LDO2_REG,
+   DA9052_LDO2_VLDO2,
+   DA9052_LDO2_LDO2EN),
+
+   DA9052_LDO(DA9052_LDO3, DA9052

Re: linaro packaged 2.6.39 kernel work in progress

2011-06-09 Thread John Rigby
This kernel _DOES_ boot.  Other things were causing my problem.

However if you do want to try this kernel with previously created
image with u-boot setup to load a devtree then I believe you will need
to change the boot.scr file to remove the loading of the device tree
since this kernel does not yet have device tree support.

With the sd card inserted and the dos partition mounted on /media/boot:

strings /boot/boot.scr > boot.txt

edit boot.txt and remove the fatload mmc 0:1 0x815f board.dtb;
part of bootcmd

mkimage -A arm -O linux -T script -C none \
-a 0 \
-e 0 \
-n "Ubuntu boot script" \
-d ./boot.txt \
/media/boot/boot.scr

unmount it and try it.



On Thu, Jun 9, 2011 at 8:45 PM, John Rigby  wrote:
> There is a packaged kernel work in progress here:
> http://git.linaro.org/gitweb?p=ubuntu/linux-linaro-oneiric.git;a=summary
> git://git.linaro.org/ubuntu/linux-linaro-oneiric.git
>
> It is based on a snapshot of linux-linaro-2.6.39 from today plus sauce
> and packaging from Ubuntu-2.6.39-3.10.
>
> The bad news is that this kernel does not even boot for me.  As I
> chase that down I would like feedback on the new configs.  They are
> dramatically reduced compared to the last cycle.  I created the new
> configs by starting with the upstream defconfigs for each soc and then
> added only what was necessary to satisfy the Ubuntu config enforce
> script.
>
> This is the perfect time in the release process to start over with
> minimal configs since we have time deal with missing options.  So
> please look at the configs and let me know what else should be turned
> on.
>
> The packaged kernel has configs split across multiple files.  Which is
> a little confusing.  Here is a synopsis:
>
> ./debian_linaro/config/config.common.ubuntu is the part that is common
> across all arch's and flavours (socs).
> ./debian_linaro/config/armel/config.common.armel has stuff common
> across all armel flavours but since we only have armel then this file
> is empty with all the common stuff propagating up to
> config.common.ubuntu.
> ./debian/linaro/config/armel/config.flavour.linaro-* contain the soc
> specific stuff.
>
> Any input appreciated.  One obvious thing I have noticed is that the
> soc specific options differ in non-soc specific ways that could be
> made consistent.  For example lots of CONFIG_CRYPTO options are not
> set in mx51 but m or y in omap.  As you see these please give your
> opinion on if all plats should make an these y, m or n.
>
> Thanks,
> John
>

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev