From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] leds: add TI LMU backlight driver
Date: Thu, 30 Aug 2018 09:40:57 -0700 [thread overview]
Message-ID: <20180830164057.GV7523@atomide.com> (raw)
In-Reply-To: <20180830082219.GA10133@amd>
* Pavel Machek <pavel@ucw.cz> [180830 08:26]:
> This adds backlight support for the following TI LMU
> chips: LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697.
...
> +struct ti_lmu_bank {
> + struct device *dev;
> + int bank_id;
> + const struct ti_lmu_bl_cfg *cfg;
> + struct ti_lmu *lmu;
> + const char *label;
> + int leds;
> + int current_brightness;
> + u32 default_brightness;
> + u32 ramp_up_msec;
> + u32 ramp_down_msec;
> +
> + struct notifier_block nb;
> +
> + struct led_classdev *led;
> +};
> +
> +static int ti_lmu_bl_enable(struct ti_lmu_bank *lmu_bank, bool enable)
> +{
> + struct regmap *regmap = lmu_bank->lmu->regmap;
> + unsigned long enable_time = lmu_bank->cfg->reginfo->enable_usec;
> + u8 *reg = lmu_bank->cfg->reginfo->enable;
> + u8 mask = BIT(lmu_bank->bank_id);
> + u8 val = (enable == true) ? mask : 0;
> + int ret;
> +
> + if (!reg)
> + return -EINVAL;
> +
> + ret = regmap_update_bits(regmap, *reg, mask, val);
> + if (ret)
> + return ret;
> +
> + if (enable_time > 0)
> + usleep_range(enable_time, enable_time + 100);
> +
> + return 0;
> +}
If it's a led driver, should you just s/ti_lmu_bl/ti_lmu_led/g?
Regards,
Tony
next prev parent reply other threads:[~2018-08-30 16:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 21:20 [rfc] leds: add TI LMU backlight driver Pavel Machek
2018-08-30 8:22 ` [PATCH] " Pavel Machek
2018-08-30 16:40 ` Tony Lindgren [this message]
2018-08-30 19:20 ` Jacek Anaszewski
2018-08-30 19:41 ` [rfc] " Dan Murphy
2018-08-30 20:18 ` Pavel Machek
2018-08-31 12:19 ` Dan Murphy
2018-08-31 21:30 ` Pavel Machek
2018-09-04 14:34 ` Dan Murphy
2018-09-06 10:16 ` Pavel Machek
2018-08-30 20:37 ` kbuild test robot
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=20180830164057.GV7523@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).