From owner-svn-src-head@freebsd.org Mon Sep 7 22:37:29 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AA7A9CCC23; Mon, 7 Sep 2015 22:37:29 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [IPv6:2a00:1450:4010:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEA7C10E9; Mon, 7 Sep 2015 22:37:28 +0000 (UTC) (envelope-from loos.br@gmail.com) Received: by lbpo4 with SMTP id o4so44494224lbp.2; Mon, 07 Sep 2015 15:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=s3EdHMoqsL82AsVOeSyRWuSjyV+px7j+joNR5aa5WZs=; b=vL6OjIakPrQd/u2aVPxYLkdbLL60t/zFspULIzdT6MSP8/pmllKl4+TTeYpFcZTUQ9 a5VnMeEMAe3bDMUP81X1roHVsMXEauv2HnvPzgqE4BWJvI230xicIB6rDutwLZrQBqUt GjK7yDA0DhBf59VdtqrOkn985E/jLVkdOYxR75Y07fPMDkyf4KPBVynJSSe3NmASMGSb hof93kSkjBMwKxPnvxUP9qjvvJWCxugWjtYnRQGA31rN46ttcH4q5fpqEw9Y7Wc6LdQp 1FJzk1XPCO7eR3nxz21vgc7zNl2x+hyLyjLGgUJ5nrChA07SkW4DiDEquNLsuSj00dqk sBvw== MIME-Version: 1.0 X-Received: by 10.112.134.197 with SMTP id pm5mr19242415lbb.3.1441665446140; Mon, 07 Sep 2015 15:37:26 -0700 (PDT) Received: by 10.112.12.234 with HTTP; Mon, 7 Sep 2015 15:37:26 -0700 (PDT) In-Reply-To: <1441664320.68284.76.camel@freebsd.org> References: <201509072159.t87LxBsw097287@repo.freebsd.org> <1441664320.68284.76.camel@freebsd.org> Date: Mon, 7 Sep 2015 19:37:26 -0300 Message-ID: Subject: Re: svn commit: r287542 - head/sys/dev/rccgpio From: Luiz Otavio O Souza To: Ian Lepore Cc: Luiz Otavio O Souza , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2015 22:37:29 -0000 On Mon, Sep 7, 2015 at 7:18 PM, Ian Lepore wrote: > On Mon, 2015-09-07 at 21:59 +0000, Luiz Otavio O Souza wrote: >> Author: loos >> Date: Mon Sep 7 21:59:11 2015 >> New Revision: 287542 >> URL: https://svnweb.freebsd.org/changeset/base/287542 >> >> Log: >> Fix off-by-one bugs. >> >> While here, only set the GPIO pin state for output pins. >> > > It's not a good idea to forbid setting output state on an input pin, > because it's a technique that's often used to preset the drive state of > a pin before changing it to be an output pin. That way a pin that > powers on to a default state of input-pulled-high can be set to drive > high before making it output, and you avoid any transitions on the pin > (which might be important if the pin is connected to, say, the > power-control input of a PMIC). > > Most hardware allows setting the output-state register bits for a pin > even if the pin is currently assigned as input. I guess if the hardware > has no way to do that, then returning EINVAL might make sense. > > -- Ian This driver is 'special', it only give access to 4 user LEDs and a reset switch. All the pins are locked in they intended setting (one input and four outputs)