mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	pali.rohar@gmail.com, sre@ring0.de, milo.kim@ti.com,
	linus.walleij@linaro.org
Cc: Bryan Wu <cooloney@gmail.com>, David Lang <david@lang.hm>,
	Joe Xue <lgxue@hotmail.com>,
	"rpurdie@rpsys.net" <rpurdie@rpsys.net>,
	"rob@landley.net" <rob@landley.net>,
	"milo.kim@ti.com" <milo.kim@ti.com>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: n900 led compiler (was Re: [PATCH] Add LED pattern trigger)
Date: Sun, 5 Jan 2014 23:23:46 +0100	[thread overview]
Message-ID: <20140105222346.GA25152@amd.pavel.ucw.cz> (raw)
In-Reply-To: <20140103152313.4fd5c48f@alan.etchedpixels.co.uk>

Hi!

> > IMHO, firstly we should take this trigger into kernel, most time it
> > works as a module. But we need to define a good interface between
> > kernel and user space.
> 
> You need the interface defined first. To do that it needs to reflect the
> actual hardware accelerated devices, and also to deal with resource
> management for those devices if necessary (eg if they can only manage one
> led of a set at a time).

Hardware can do quite a lot:

http://wiki.maemo.org/LED_patterns#Lysti_Format_Engine_Patterns_and_Commands

(and more).

I implemented compiler for it (should we put it into tools/ somewhere?)

https://gitorious.org/tui/tui/source/5b3f5cacf8e208d3ea50d6066e549940d85e55be:maemo/notcc.py

It can do quite a lot, including prime number computation. This uses
33% of program memory and only one of three execution units; but it
does not work, maybe I made mistake somewhere or maybe our kernel
can't take program this long. It only has 3 writable variables, which
is quite limiting.

start()
a = 1
next_number: a += 1
b = 1
next_divisor: b += 1
br = b
if (b==a) goto is_prime
c = 0
c = c+b
test_prime: if (c==a) goto not_prime
if (a<c) goto not_divisor
c = c+b
goto test_prime
not_divisor: goto next_divisor
not_prime: goto next_number
is_prime: b = 0
show_prime: c = 255
br = c
ramp_up_long(30,0)
c = 0
br = c
ramp_up_long(30,0)
b += 1
if (b == a) goto next_number2
goto show_prime
next_number2: goto next_number

> So the starting point has to be the hardware accelerated devices, whether
> you then support software emulation in kernel or user space is a follow
> on discussion. What the kernel/user API is also has to be a follow on

Well... this one is turing complete, and I have a compiler, but I
don't think it is good interface, either for library or kernel.

I believe series of RGB values might be good interface, maybe with
additional "want interpolation between these".
     		      	  	      	     	      	      	     Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2014-01-05 22:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30  0:11 [PATCH] Add LED pattern trigger Joe Xue
2013-12-30 16:21 ` One Thousand Gnomes
2013-12-30 23:24   ` Joe Xue
2013-12-31  0:18     ` One Thousand Gnomes
2013-12-31 18:48   ` Joe Xue
2014-01-01 20:10     ` One Thousand Gnomes
2014-01-01 22:44       ` David Lang
2014-01-01 23:01         ` One Thousand Gnomes
2014-01-01 23:51           ` David Lang
2014-01-03  0:14             ` Bryan Wu
2014-01-03  9:33               ` Richard Weinberger
2014-01-03 15:23               ` One Thousand Gnomes
2014-01-05 22:23                 ` Pavel Machek [this message]
2014-01-07 15:40                   ` n900 led compiler (was Re: [PATCH] Add LED pattern trigger) Linus Walleij
2013-12-30 18:33 ` [PATCH] Add LED pattern trigger Pavel Machek
2013-12-31  5:00   ` Joe Xue
2013-12-31 11:33     ` Pavel Machek
2013-12-31 12:29       ` Richard Weinberger
2013-12-31 19:03         ` Pavel Machek
2014-01-01 20:11           ` One Thousand Gnomes
2014-01-01  2:57 ` [PATCH v2 1/1] leds: " Joe Xue
2014-01-01  3:03 ` [PATCH v2 1/1] " Joe Xue
2014-01-06 21:47 ` [PATCH v3 1/1] leds: " lgxue
2014-01-06 22:10   ` Joe Xue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140105222346.GA25152@amd.pavel.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=cooloney@gmail.com \
    --cc=david@lang.hm \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=lgxue@hotmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=pali.rohar@gmail.com \
    --cc=rob@landley.net \
    --cc=rpurdie@rpsys.net \
    --cc=sre@ring0.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®