Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2019 13:29:54 +0300
From:      Michael Zhilin <mizhka@gmail.com>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: setting driver properties for a particular device
Message-ID:  <CAF19XBJws3ESf9voiW655PH=z1a-rVEgF903=bm7oJ4DGWNy5w@mail.gmail.com>
In-Reply-To: <523f92fe-c106-db6b-00d9-356913fdca5d@FreeBSD.org>
References:  <201905231115.x4NBFMSu037564@repo.freebsd.org> <523f92fe-c106-db6b-00d9-356913fdca5d@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

There are kenv and sysctl. Is it far from what you are looking for?

Thanks!

On Wed, May 29, 2019 at 1:19 PM Andriy Gapon <avg@freebsd.org> wrote:

> On 23/05/2019 14:15, Andriy Gapon wrote:
> > Author: avg
> > Date: Thu May 23 11:15:22 2019
> > New Revision: 348153
> > URL: https://svnweb.freebsd.org/changeset/base/348153
> >
> > Log:
> >   gpioled: add a new hint for initial state
> >
> >   hint.gpioled.%d.state determines the initial state of the LED when the
> >   driver takes control over it:
> >     0 - the LED is off
> >     1 - the LED is on
> >    -1 - the LED is kept as it was
>
> By the way, can anyone suggest a mechanism to set device properties like
> this
> one _programmatically_ ?
>
> I am thinking of a case where I know exactly how everything is wired on a
> platform.  And there is no FDT or alike support for it.  And hints are not
> possible to set up correctly (e.g., bus numbers may float).  So, I want to
> create a gpioled child on a specific bus and I want to set some properties
> for
> the device.
> Of course, I can probably do something like kern_setenv("hints.foo.X.bar",
> ...)
> using the child's name and unit number.  But that feels a bit cumbersome.
>
> And this question is not about gpioled specifically.
>
> IVARs is definitely not the right mechanism, because it is about
> bus-specific
> properties of devices on the bus.  So, it is not aware of properties
> specific to
> a driver that attaches to a child device.
>
>
> --
> Andriy Gapon
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF19XBJws3ESf9voiW655PH=z1a-rVEgF903=bm7oJ4DGWNy5w>