Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: "Lee Jones" <lee@kernel.org>,
	"Daniel Thompson" <danielt@kernel.org>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Pavel Machek" <pavel@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Helge Deller" <deller@gmx.de>, "Johan Hovold" <johan@kernel.org>,
	dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v2 2/6] mfd: lm3533: Convert to use OF bindings
Date: Fri, 29 May 2026 14:10:31 +0100	[thread overview]
Message-ID: <20260529141031.62703eff@jic23-huawei> (raw)
In-Reply-To: <CAPVz0n1u0z35rP8vUKjAzW_mrPm9yeMjK_-nKbyctUvQik6ECw@mail.gmail.com>


> > > > > >         if (device_property_present(dev, "ti,resistor-value-ohm"))
> > > > > >                 ret = device_property_read_u32();
> > > > > >                 if (ret) //corrupt property in some fashion
> > > > > >                         return ret;
> > > > > >         } else {
> > > > > >                 //set default
> > > > > >         }
> > > > > > If there is no default then check it unconditionally.  
> > > > >
> > > > > default value is LM3533_ALS_RESISTOR_MIN and if no property is present
> > > > > clamp will ensure that als->r_select will be set to
> > > > > LM3533_ALS_RESISTOR_MIN  
> > > >
> > > > I don't see that default in the binding doc and relying in the 0 being clamped
> > > > isn't particularly readable - I'd set it explicitly.
> > > >  
> > >
> > > Oh, ye, my bad. Schema enforces one of props to be present and if pwn
> > > is present then resistor is ignored. What if I move resistor reading,
> > > clamping and conversion under !als->pwm_mode check? Then resistor must
> > > be present and hence must be checked unconditionally.  
> >
> > Sounds good.
> >  
> > >
> > > Additionally, I can comment original lm3533_als_setup with #if 0
> > > #endif then git formatting will be much cleaner and easier to review,
> > > and once we all come to result I will just remove entire commented
> > > block and Lee can pick clean commits.  
> >
> > No don't do that.  If you flatten the two helpers as a precursor patch
> > then the changes in here will be easier to review anyway.
> >  
> 
> By "flatten the two helpers" you mean incorporate
> lm3533_als_set_input_mode and lm3533_als_set_resistor into
> lm3533_als_setup first and then convert it to use DT? I am asking,
> just to be sure.
> 

yes

> > > > > > > @@ -852,25 +825,28 @@ static int lm3533_als_probe(struct platform_device *pdev)
> > > > > > >       indio_dev->channels = lm3533_als_channels;
> > > > > > >       indio_dev->num_channels = ARRAY_SIZE(lm3533_als_channels);
> > > > > > >       indio_dev->name = dev_name(&pdev->dev);
> > > > > > > -     iio_device_set_parent(indio_dev, pdev->dev.parent);  
> > > > > >
> > > > > > I'm not sure why this was there in the first place.  Hence not sure if it
> > > > > > is safe to remove.
> > > > > >  
> > > > >
> > > > > This is directly related to OF conversion. The iio_device_set_parent
> > > > > bound indio_dev to parent, and it causes problems with OF now since
> > > > > als output has its own node and binding it to parent if wrong. Same
> > > > > story for backlight and leds btw.  
> > > >
> > > > Is there any risk anyone was using the canonical path to get to the iio dev?
> > > > /sys/bus/platform/devices/..../iio\:deviceX
> > > > This is technically an ABI change be it a subtle one.
> > > >  
> > >
> > > Linux kernel has no users of this driver, and it is in "stale" state
> > > for more then 2 years (maybe even longer). I have cc'd Johan Hovold.
> > >
> > > https://lore.kernel.org/lkml/ZmBcvtLCzllQDWVX@hovoldconsulting.com/
> > >
> > > This this 2 y. o. discussion and there were no actions ore movements.
> > > I assume this driver in its current form has no more users. This does
> > > not mean that it cannot be revived though.  
> >
> > So, just to check, are you a user of this code or is this more trying to
> > help out with old code?
> >  
> 
> I am not insane enough to get myself into all this conversion if I did
> not need it. This is one of 2 remaining gaps in support of LG
> P880/P895 I own and support. I would really like to finally mainline
> all the patches I have locally since maintaining them becomes quite
> troublesome with time and additional patches layering on top.

Excellent! There are some odd people out there who do start on this
sort of thing despite no personal use case :)

Jonathan




  reply	other threads:[~2026-05-29 13:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 13:51 [PATCH v2 0/6] mfd: lm3533: convert to OF bindings, improve support Svyatoslav Ryhel
2026-05-28 13:51 ` [PATCH v2 1/6] dt-bindings: leds: Document TI LM3533 LED controller Svyatoslav Ryhel
2026-05-28 14:54   ` Jonathan Cameron
2026-05-29  9:51   ` Daniel Thompson
2026-05-29 10:07     ` Svyatoslav Ryhel
2026-05-29 10:46       ` Daniel Thompson
2026-05-29 10:56         ` Svyatoslav Ryhel
2026-05-28 13:51 ` [PATCH v2 2/6] mfd: lm3533: Convert to use OF bindings Svyatoslav Ryhel
2026-05-28 14:50   ` Jonathan Cameron
2026-05-28 15:03     ` Svyatoslav Ryhel
2026-05-29  9:08       ` Jonathan Cameron
2026-05-29  9:39         ` Svyatoslav Ryhel
2026-05-29 10:48           ` Jonathan Cameron
2026-05-29 11:02             ` Svyatoslav Ryhel
2026-05-29 13:10               ` Jonathan Cameron [this message]
2026-05-29 11:00   ` Daniel Thompson
2026-05-29 11:06     ` Svyatoslav Ryhel
2026-05-28 13:51 ` [PATCH v2 3/6] mfd: lm3533: Add support for VIN power supply Svyatoslav Ryhel
2026-05-28 13:51 ` [PATCH v2 4/6] mfd: lm3533: Set DMA mask Svyatoslav Ryhel
2026-05-28 13:51 ` [PATCH v2 5/6] video: backlight: lm3533_bl: Set initial mapping mode from DT Svyatoslav Ryhel
2026-05-29 11:10   ` Daniel Thompson
2026-05-29 11:17     ` Svyatoslav Ryhel
2026-05-29 11:40       ` Daniel Thompson
2026-05-28 13:51 ` [PATCH v2 6/6] video: leds: backlight: lm3533: Support getting LED sources " Svyatoslav Ryhel

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=20260529141031.62703eff@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=danielt@kernel.org \
    --cc=deller@gmx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=johan@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=pavel@kernel.org \
    --cc=robh@kernel.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