From owner-freebsd-hackers@freebsd.org Wed May 29 10:30:07 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC8A15BE7E4 for ; Wed, 29 May 2019 10:30:07 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 221388C9C5; Wed, 29 May 2019 10:30:06 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-ua1-x936.google.com with SMTP id 7so704267uah.1; Wed, 29 May 2019 03:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5g89VnQP8VmIwtIeDZwYqvxmZURHD/YG/FUxm0hI8QA=; b=WKyqTUBUW9p8TMGA9KrnslIvr58d9WGY6PNsoBfigfQsU7CUcdA3AyVjcRLFi1p7AB iofy8bzdjadLqeBrNsqw6L48QIWyNPHLs0Z+N9uruVD2Ha1Ol0b/8ZXny/mMXNtAqdYu YDIJcCjXj9/YWAdKy8s8c1y9bmIwf/QdPGPFvjas8XwCST1OyAWr7rwjYuyPgekkm+e0 MW6g8fsURmb4D8aR9Wqpc4BHm717rh4XWXMHFFfDrIpe9cblVbnGXv5P8EOpQrokvtlT YzKOxTAqQ3UWTBGK5VfIDJ/NYbIeXQqaaiBdEjVHqNry8R7ABEytZG2kzrF1H32mWue8 ttcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5g89VnQP8VmIwtIeDZwYqvxmZURHD/YG/FUxm0hI8QA=; b=X8SF7vOIDJalECB7TpZ7mlI9s2Gdr9l1XtMH0aRRNpvtorv83P1vvXQ6tlEBwHZfL7 CCF6B+5y9sblShtO9u3wZ2LiME1vN3R7uet/snknorgSk+lD9bfsniJmeB/2ycU6fdu6 tR+QLuQfYq32ZLcLjncko23cdShxkpRIoEYhPhIIZ2JsUoNB8GgRhEMnp3PlX6eOqpLZ Z3Ig7ZNXgYbJzoMYqccpzS/VUPY/wD/iCor1XEXFnL2XOOPRESKRijOrZaYVn2CSEUVn OlI/VruFbEXvtrwqY0FUoria+bPS9+5IWTG6EIsHiY/RM+P3ppa0c2TSjDwLCQXyekvc FGrQ== X-Gm-Message-State: APjAAAWAJ2OwUy40hEPfAGsLXJRJSD5IZJJfZarlq/+k1hWvS6nA06hX TDwdDVTSgMlrSWEK1/eyJQ+YAZJ/IjXDVVEDTizNCgMr X-Google-Smtp-Source: APXvYqwvGGgShtxOLjb/MvKVqip4P2+TdjkgQ1KnZV1bIt75eTJGtzJIvQ8YycFnqwhqEmwzLfIZJCHL7Cr9m7LwRtA= X-Received: by 2002:ab0:5a07:: with SMTP id l7mr27845431uad.78.1559125805191; Wed, 29 May 2019 03:30:05 -0700 (PDT) MIME-Version: 1.0 References: <201905231115.x4NBFMSu037564@repo.freebsd.org> <523f92fe-c106-db6b-00d9-356913fdca5d@FreeBSD.org> In-Reply-To: <523f92fe-c106-db6b-00d9-356913fdca5d@FreeBSD.org> From: Michael Zhilin Date: Wed, 29 May 2019 13:29:54 +0300 Message-ID: Subject: Re: setting driver properties for a particular device To: Andriy Gapon Cc: FreeBSD Hackers X-Rspamd-Queue-Id: 221388C9C5 X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=WKyqTUBU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mizhka@gmail.com designates 2607:f8b0:4864:20::936 as permitted sender) smtp.mailfrom=mizhka@gmail.com X-Spamd-Result: default: False [-7.06 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[6.3.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-3.08)[ip: (-9.77), ipnet: 2607:f8b0::/32(-3.30), asn: 15169(-2.29), country: US(-0.06)]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 10:30:07 -0000 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 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" >