From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Olimpiu Dejeu <olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org>
Cc: robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 1/2] backlight: arcxcnn: add support for ArticSand devices
Date: Thu, 29 Sep 2016 20:32:05 +0100 [thread overview]
Message-ID: <20160929193204.GB3405@remoulade> (raw)
In-Reply-To: <1475166879-6255-1-git-send-email-olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org>
On Thu, Sep 29, 2016 at 12:34:39PM -0400, Olimpiu Dejeu wrote:
> Resubmition of arcxcnn backliught driver adding definitions of the
> internal registers of the chip.
s/backliught/backlight/
[...]
> +#ifdef CONFIG_OF
> +static int arcxcnn_parse_dt(struct arcxcnn *lp)
> +{
> + struct device *dev = lp->dev;
> + struct device_node *node = dev->of_node;
> + u32 prog_length, prog_val, num_entry, sources[6];
> + int ret;
> +
> + if (!node) {
> + dev_err(dev, "no platform data.\n");
> + return -EINVAL;
> + }
> + of_property_read_string(node, "label", &lp->pdata->name);
> + of_property_read_u32(node, "default-brightness", &prog_val);
> + lp->pdata->initial_brightness = prog_val;
You must check the return value of the of_ accessors. If there's no
default-brightness property in the DT, prog_val will be uninitialised here.
> + of_property_read_u32(node, "pwm-period", &lp->pdata->period_ns);
This was not in the binding document.
> + /* Fill program from platform data if defined
> + */
> + lp->pdata->prog_entries = 0;
> + prog_length = of_get_child_count(node);
> + if (prog_length > 0) {
> + struct device_node *child;
> + u32 i = 0;
> +
> + for_each_child_of_node(node, child) {
> + if (i >= ARCXCNN_MAX_PROGENTRIES)
> + break;
> + of_property_read_u32(child, "reg", &prog_val);
> + lp->pdata->prog_addr[i] = (u8)prog_val;
> + of_property_read_u32(child, "val", &prog_val);
> + lp->pdata->prog_data[i] = (u8)prog_val;
> + i++;
> + }
> + lp->pdata->prog_entries = i;
> + }
This was also not documented.
What is this? What is it used for? Why is it in the DT?
> + /* playback program now that its all installed */
> + for (i = 0; i < lp->pdata->prog_entries; i++) {
> + arcxcnn_write_byte(lp, lp->pdata->prog_addr[i],
> + lp->pdata->prog_data[i]);
> + /*
> + printk(KERN_ALERT "%02X, %02X\n",
> + lp->pdata->prog_addr[i], lp->pdata->prog_data[i]);
> + */
> + }
Why is it necessary to have an arbitrary register programming sequence? What
exactly varies between parts?
I don't think this is the right way to solve your problem.
Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-09-29 19:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 16:34 [PATCH 1/2] backlight: arcxcnn: add support for ArticSand devices Olimpiu Dejeu
[not found] ` <1475166879-6255-1-git-send-email-olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org>
2016-09-29 19:32 ` Mark Rutland [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-10-26 20:29 Olimpiu Dejeu
[not found] ` <1477513778-31297-1-git-send-email-olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org>
2016-11-09 15:53 ` Lee Jones
2016-11-10 8:14 ` Lee Jones
2016-11-03 18:29 Olimpiu Dejeu
2016-11-10 15:44 Olimpiu Dejeu
[not found] ` <1478792647-5813-1-git-send-email-olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org>
2016-11-18 18:40 ` Lee Jones
2016-11-18 15:17 Olimpiu Dejeu
2016-11-21 11:57 ` Lee Jones
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=20160929193204.GB3405@remoulade \
--to=mark.rutland-5wv7dgnigg8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=olimpiu-eV7fy4qpoLhpLGFMi4vTTA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).