From: Richard Purdie <rpurdie@rpsys.net>
To: Marcin Juszkiewicz <openembedded@hrw.one.pl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] backlight control for Frontpath ProGear HX1050+
Date: Tue, 06 Feb 2007 19:26:58 +0000 [thread overview]
Message-ID: <1170790019.5826.105.camel@localhost.localdomain> (raw)
In-Reply-To: <200702061430.42581.openembedded@hrw.one.pl>
On Tue, 2007-02-06 at 14:30 +0100, Marcin Juszkiewicz wrote:
> From: Marcin Juszkiewicz <openembedded@hrw.one.pl>
>
> Add control of LCD backlight for Frontpath ProGear HX1050+.
> Patch is based on http://downloads.sf.net/progear/progear-lcd-0.2.tar.gz
> driver by M Schacht.
>
> Signed-Off-By: Marcin Juszkiewicz <openembedded@hrw.one.pl>
This is very similar to corgi_bl which I have some changes I was
considering to make it a bit more efficient/clean. The same changes
could apply to this driver:
> +static int progearbl_intensity;
> +static struct backlight_properties progearbl_data;
Not sure you need the above line?
> +static struct backlight_device *progear_backlight_device;
You shouldn't need this structure pointer (see below)
> +static int progearbl_get_intensity(struct backlight_device *bd)
> +{
> + return progearbl_intensity;
> +}
Can you read PMU_LPCR and return it (minus HW_LEVEL_MIN) here? corgi_bl
only stores this as it can't read back from the hardware. Either
approach is probably ok (although if the register can be updated by
other means, it should be read).
> +static int progearbl_set_intensity(struct backlight_device *bd)
> +{
> + progearbl_send_intensity(progear_backlight_device);
> + return 0;
> +}
You can use progearbl_send_intensity(bd); here or maybe lose the
function all together?
> +static struct backlight_properties progearbl_data = {
> + .owner = THIS_MODULE,
> + .get_brightness = progearbl_get_intensity,
> + .update_status = progearbl_set_intensity,
progearbl_send_intensity?
> + pci_read_config_byte(sb_dev, SB_MPS1, &temp);
> + pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20);
> +
> + progear_backlight_device = backlight_device_register("progear-bl",
> + &pdev->dev, NULL, &progearbl_data);
> + if (IS_ERR(progear_backlight_device))
> + return PTR_ERR(progear_backlight_device);
platform_set_drvdata(pdev, progear_backlight_device);
> + progearbl_data.power = FB_BLANK_UNBLANK;
> + progearbl_data.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
> + progearbl_data.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
> + progearbl_send_intensity(progear_backlight_device);
> +
> + return 0;
> +}
> +
> +static int progearbl_remove(struct platform_device *dev)
> +{
> + backlight_device_unregister(progear_backlight_device);
struct backlight_device *bd = platform_get_drvdata(pdev);
backlight_device_unregister(bd);
> + return 0;
> +}
All pretty minor though and if you change the above, it can have an
Acked-by: Richard Purdie <rpurdie@rpsys.net>
--
Richard
next prev parent reply other threads:[~2007-02-06 19:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-06 13:30 Marcin Juszkiewicz
2007-02-06 19:26 ` Richard Purdie [this message]
2007-02-07 8:02 ` Marcin Juszkiewicz
-- strict thread matches above, loose matches on Subject: below --
2007-01-05 8:03 Marcin Juszkiewicz
2007-01-05 8:23 ` Russell King
2007-01-05 9:55 ` Marcin Juszkiewicz
2007-01-05 9:39 ` Alan
2007-01-05 11:15 ` Marcin Juszkiewicz
2007-01-05 14:03 ` Mariusz Kozlowski
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=1170790019.5826.105.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=linux-kernel@vger.kernel.org \
--cc=openembedded@hrw.one.pl \
/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
Powered by JetHome