linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: joeyli <jlee@suse.com>
To: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
Cc: rpurdie@rpsys.net, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Subject: Re: [PATCH] Added backlight driver for Acer Aspire 4736
Date: Tue, 13 Mar 2012 03:10:45 +0000	[thread overview]
Message-ID: <1331608245.10557.149.camel@linux-s257.site> (raw)
In-Reply-To: <4F5D000E.8040104@gmx.de>

Hi Pradeep, 

於 日,2012-03-11 於 19:42 +0000,Florian Tobias Schandinat 提到:
> Hi,
> 
> On 03/11/2012 06:21 PM, Pradeep Subrahmanion wrote:
> > Hi ,
> > 
> >          Brightness control was not  working on Acer Aspire 4736 using
> > default ACPI interface.  acer-acpi also do not support 4730 series since
> > it uses new WMI interface.
> > This driver adds brightness control by accessing the LBB PCI
> > configuration register. This approach may also work on other laptops in
> > 4730 series .But currently ,  it is only tested  for 
> > Aspire 4736.  
> > 

Pleae check does there have following interface?

/sys/class/backlight/intel_backlight

And,
did you try kernel parameter "acpi_backlight=vendor", does it work to
you?

Please attach acpidump: acpidump > acpidump.dat


Thanks
Joey Lee

> > From 893031c1e9bdefd9642b98825062b5df98af0d77 Mon Sep 17 00:00:00 2001
> > From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>
> > Date: Sun, 11 Mar 2012 23:11:23 -0400
> > Subject: [PATCH] Added backlight driver for Acer Aspire 4736
> > 
> 
> the commit message should be here, I think.
> 
> > 
> > Signed-off-by: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>
> 
> Please resend this email in the correct format: As you can see in my
> email the text version of your patch is severely screwed up and nobody
> wants to even try converting a HTML format to a proper patch again,
> probably most people won't even receive an email that has a HTML part as
> their spam filter are going to handle it as spam. git send-email will
> take care of it for you if you configure it for your account.
> You should also cc Andrew Morton <akpm@linux-foundation.org> as he's the
> one who handles backlight patches at the moment.
> 
> 
> Best regards,
> 
> Florian Tobias Schandinat
> 
> > ---
> >  drivers/video/backlight/acer4736_bl.c |  110
> > +++++++++++++++++++++++++++++++++
> >  1 files changed, 110 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/video/backlight/acer4736_bl.c
> > 
> > diff --git a/drivers/video/backlight/acer4736_bl.c
> > b/drivers/video/backlight/acer4736_bl.c
> > new file mode 100644
> > index 0000000..6fe2937
> > --- /dev/null
> > +++ b/drivers/video/backlight/acer4736_bl.c
> > @@ -0,0 +1,110 @@
> > +/*
> > + * Backlight driver for Acer Aspire 4736
> > + *
> > + * Copyright (C) Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
> > + * This driver uses LBB PCI configuration register to change the
> > + * backlight brightness.
> > + *
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/init.h>
> > +#include <linux/backlight.h>
> > +#include <linux/err.h>
> > +#include <linux/dmi.h>
> > +#include <linux/io.h>
> > +#include <linux/pci.h>
> > +
> > +static u8 max_brightness = 0xFF;
> > +static u8 lbb_offset =  0xF4;
> > +static unsigned int device_id = 0x2a42;
> > +static unsigned int vendor_id = 0x8086;
> > +
> > +struct backlight_device *acer_backlight_device;
> > +struct pci_dev *pdev;
> > +
> > +static int acer_dmi_match(const struct dmi_system_id *id)
> > +{
> > + printk(KERN_INFO "acer4736_bl: %s detected\n", id->ident);
> > + return 1;
> > +}
> > +
> > +static const struct dmi_system_id __initdata acer_device_table[] = {
> > +{
> > + .callback = acer_dmi_match,
> > + .ident = "Aspire 4736",
> > + .matches = {
> > + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> > + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
> > + },
> > + },
> > + {}
> > +};
> > +static int read_brightness(struct backlight_device *bd)
> > +{
> > + u8 result;
> > + pci_read_config_byte(pdev, lbb_offset, &result);
> > + return result;
> > +}
> > +
> > +static int update_brightness(struct backlight_device *bd)
> > +{
> > + u8 intensity = bd->props.brightness;
> > + if (intensity > max_brightness) {
> > + printk(KERN_INFO "Acer4736_bl: Invalid parameter. Maximum value is %d"
> > + , max_brightness);
> > + return -1;
> > + }
> > + pci_write_config_byte(pdev, lbb_offset, intensity);
> > + return 0;
> > +}
> > +static const struct  backlight_ops acer_backlight_ops = {
> > + .get_brightness = read_brightness,
> > + .update_status  = update_brightness,
> > +};
> > +
> > +static int __init acer4736_bl_init(void)
> > +{
> > + struct backlight_properties props;
> > + if (!dmi_check_system(acer_device_table))
> > + return -ENODEV;
> > +
> > + pdev = pci_get_device(vendor_id, device_id, NULL);
> > +
> > + if (!pdev)
> > + return -ENODEV;
> > +
> > + printk(KERN_INFO "Loading Acer 4736 backlight driver\n");
> > + memset(&props, 0, sizeof(struct backlight_properties));
> > + props.type = BACKLIGHT_RAW;
> > + props.max_brightness = max_brightness;
> > +
> > + acer_backlight_device = backlight_device_register("acer_backlight",
> > + NULL, NULL, &acer_backlight_ops, &props);
> > + acer_backlight_device->props.max_brightness = max_brightness;
> > + acer_backlight_device->props.brightness  > > + read_brightness(acer_backlight_device);
> > + backlight_update_status(acer_backlight_device);
> > +
> > + return 0;
> > +}
> > +
> > +static void __exit acer4736_bl_exit(void)
> > +{
> > + pci_dev_put(pdev);
> > + backlight_device_unregister(acer_backlight_device);
> > +}
> > +
> > +module_init(acer4736_bl_init);
> > +module_exit(acer4736_bl_exit);
> > +
> > +MODULE_AUTHOR("Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com
> > <mailto:subrahmanion.pradeep@gmail.com>>");
> > +MODULE_DESCRIPTION("Acer Aspire 4736 Backlight Driver");
> > +MODULE_LICENSE("GPL");
> > +MODULE_DEVICE_TABLE(dmi, acer_device_table);
> > -- 
> > 1.7.2.5
> > 
> > -------------  
> > 
> > Pradeep Subrahmanion
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 



  parent reply	other threads:[~2012-03-13  3:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABNxG=CU+bOWUauLYfcS2vtFqKvXA-9axgokNoYz+KuU1Mzztw@mail.gmail.com>
2012-03-11 19:42 ` [PATCH] Added backlight driver for Acer Aspire 4736 Florian Tobias Schandinat
2012-03-12 17:36   ` Pradeep Subrahmanion
2012-03-12 17:51     ` Matthew Garrett
     [not found]       ` <1331640592.3485.50.camel@debian.Gayathri>
2012-03-13 12:47         ` Matthew Garrett
     [not found]           ` <CABNxG=Dqg26EHmC3vibf3-SjVhby1qgQfMniQObUeh9eJ6SwEw@mail.gmail.com>
2012-03-13 13:34             ` Matthew Garrett
2012-03-13 15:49               ` Pradeep Subrahmanion
2012-03-13 23:12                 ` joeyli
2012-03-14  2:55                   ` Pradeep Subrahmanion
2012-03-14  5:51                     ` joeyli
2012-03-14  6:29                       ` Pradeep Subrahmanion
2012-03-15  8:05                         ` joeyli
2012-03-18  5:22                           ` Pradeep Subrahmanion
2012-03-19  2:01                             ` joeyli
2012-03-19 11:45                               ` Pradeep Subrahmanion
2012-03-20  3:55                                 ` joeyli
2012-03-20 11:09                               ` joeyli
2012-03-20 18:55                                 ` Pradeep Subrahmanion
2012-03-21  3:00                                   ` joeyli
2012-03-21 19:21                                     ` Pradeep Subrahmanion
2012-03-22  1:33                                       ` joeyli
2012-03-22  2:45                                         ` Pradeep Subrahmanion
2012-03-22  3:25                                           ` joeyli
2012-03-22  3:44                                             ` Pradeep Subrahmanion
2012-03-22  3:54                                               ` joeyli
2012-03-22  5:57                                                 ` Pradeep Subrahmanion
2012-03-22  9:34                                                   ` joeyli
2012-03-22 16:29                                                     ` Pradeep Subrahmanion
2012-03-23  3:48                                     ` Pradeep Subrahmanion
2012-03-23  4:25                                       ` joeyli
2012-03-18  5:24                           ` Pradeep Subrahmanion
2012-03-13 13:41           ` Pradeep Subrahmanion
2012-03-12 23:07     ` Joe Perches
2012-03-12 17:40   ` Pradeep Subrahmanion
2012-03-13  3:10   ` joeyli [this message]
     [not found]     ` <1331644360.3319.6.camel@debian.Gayathri>
2012-03-13  4:35       ` joeyli

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=1331608245.10557.149.camel@linux-s257.site \
    --to=jlee@suse.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=subrahmanion.pradeep@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).