lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 28 Nov 2012 10:11:03 +0800
From:	Qing Xu <qingx@...vell.com>
To:	Haojian Zhuang <haojian.zhuang@...il.com>
Cc:	"rpurdie@...ys.net" <rpurdie@...ys.net>,
	"FlorianSchandinat@....de" <FlorianSchandinat@....de>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Chao Xie <cxie4@...vell.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [PATCH 6/7] mfd: max8925: support dt for backlight

On 11/23/2012 05:08 PM, Haojian Zhuang wrote:
> On Tue, Nov 6, 2012 at 3:47 PM, Qing Xu <qingx@...vell.com> wrote:
>> From: Qing Xu <qingx@...vell.com>
>>
>> Signed-off-by: Qing Xu <qingx@...vell.com>
>> ---
>>   drivers/video/backlight/max8925_bl.c |   31 ++++++++++++++++++++++++++++++-
>>   1 files changed, 30 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c
>> index f72ba54..7de02ed 100644
>> --- a/drivers/video/backlight/max8925_bl.c
>> +++ b/drivers/video/backlight/max8925_bl.c
>> @@ -101,6 +101,29 @@ static const struct backlight_ops max8925_backlight_ops = {
>>          .get_brightness = max8925_backlight_get_brightness,
>>   };
>>
>> +#ifdef CONFIG_OF
>> +static int max8925_backlight_dt_init(struct platform_device *pdev,
>> +                             struct max8925_backlight_pdata *pdata)
>> +{
>> +       struct device_node *nproot = pdev->dev.parent->of_node, *np;
>> +       int dual_string;
>> +
>> +       if (!nproot)
>> +               return -ENODEV;
>> +       np = of_find_node_by_name(nproot, "backlight");
>> +       if (!np) {
>> +               dev_err(&pdev->dev, "failed to find backlight node\n");
>> +               return -ENODEV;
>> +       }
>> +
>> +       of_property_read_u32(np, "dual-string", &dual_string);
> Please use the property like "maxium,max8925-dual-string" at here. It's used
> to avoid naming conflict.

patch updated in v2, and dts patch update in v3

>> +       pdata->dual_string = dual_string;
>> +       return 0;
>> +}
>> +#else
>> +#define max8925_backlight_dt_init(x, y)        (-1)
>> +#endif
>> +
>>   static int __devinit max8925_backlight_probe(struct platform_device *pdev)
>>   {
>>          struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
>> @@ -150,6 +173,13 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev)
>>          platform_set_drvdata(pdev, bl);
>>
>>          value = 0;
>> +       if (pdev->dev.parent->of_node && !pdata) {
>> +               pdata = devm_kzalloc(&pdev->dev,
>> +                                    sizeof(struct max8925_backlight_pdata),
>> +                                    GFP_KERNEL);
>> +               max8925_backlight_dt_init(pdev, pdata);
>> +       }
>> +
>>          if (pdata) {
>>                  if (pdata->lxw_scl)
>>                          value |= (1 << 7);
>> @@ -161,7 +191,6 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev)
>>          ret = max8925_set_bits(chip->i2c, data->reg_mode_cntl, 0xfe, value);
>>          if (ret < 0)
>>                  goto out_brt;
>> -
>>          backlight_update_status(bl);
>>          return 0;
>>   out_brt:
>> --
>> 1.7.0.4
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ