Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1665043pxj; Wed, 19 May 2021 10:59:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5D62D7n//MDEPotPSa1O0jkFomcsXODX33VwEgCurP2cHqe3/JUpuGR8nCgUpmNDu6eWb X-Received: by 2002:a05:6402:30a2:: with SMTP id df2mr291504edb.176.1621447140797; Wed, 19 May 2021 10:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447140; cv=none; d=google.com; s=arc-20160816; b=M+Wg2h46An9eFVpa2irHLspFdlIKWR4l3oe081ovENRkSQkMq86yB97zD75ORAm9ww cax6zbh5ESTYkyEErvGEn7UCcFV+/ceCIZDQAM5MMBeMLQXsN0QeGzYKk1ktaZFynbKv 31FRYitA4Tz1kdCp3bhpzY2B2PZl+YlJfUtydQx9RmxCAibBrizncP+fIKzrOgIRrrj7 J5ULSj6+SwDePtQGKs6wtpu36zo12YSZFcSDvvosArab6uLig7VeJ+NEaxsx6te1C2Dn JOyhbj8Z/mCgqxjFqylwpW6UPV9eEoyh1fPOynSMBnRiFlXitrt9IyyfP/Zz+Mm4P5zP YnBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=uwmdW801vRB3PpGUwtnmy412PKt6fejTaQGhH97dxaI=; b=mcwQPEhEDX22UOUkQPzw0K9H8Bg3aID8IQJa3+9Q3el3IcnZlAYzQ/c71fIAEmCk3Z twrlJzSQy2sKA4tKdfrBlRUiCDN3kIHeSOjpWMsPgG57g/T9cANJB4ljlImXPG7+3jz4 xnO1+NYjdnVZFANu4FgD06et8Y9c8l9qSs0be3MlnT3+hTl+1rWSdoluUXWMzYuUAPkj WFDg+I8rzQSzZilD33bmZo55xqxM1IK4WKuDsx3L+hhQTq20vjkh95a50utX84eXso2U BCz0ZWDFWVROgxg2hXf63ddQA/Tdnt2DpjsVMZDVHwqm1EGx/Ixfhj0mImLkXtbWQZTh tCwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=imcG4dei; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj23si423986ejb.7.2021.05.19.10.58.37; Wed, 19 May 2021 10:59:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=imcG4dei; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244773AbhERLkg (ORCPT + 99 others); Tue, 18 May 2021 07:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244606AbhERLkf (ORCPT ); Tue, 18 May 2021 07:40:35 -0400 Received: from polaris.svanheule.net (polaris.svanheule.net [IPv6:2a00:c98:2060:a004:1::200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF1C5C06175F for ; Tue, 18 May 2021 04:39:17 -0700 (PDT) Received: from [IPv6:2a02:a03f:eafb:ee01:6102:7bbd:c7da:85a4] (unknown [IPv6:2a02:a03f:eafb:ee01:6102:7bbd:c7da:85a4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 075CB200155; Tue, 18 May 2021 13:39:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1621337955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uwmdW801vRB3PpGUwtnmy412PKt6fejTaQGhH97dxaI=; b=imcG4dei6UyHr6SFf4F0c1hXxbKSIYueqDyCAEL6DmGi6QLXqliwyNb1JJNNfBl6mJSlfS qVltN5tq7OFNwOi9jF4V1GE2FyHOldZzf+OzNxW8BWL1yOy2Hq4BOZjIVQ5j8k2BzFseRH 5aMb1AYhrH9qSJo2HGU+l/Pk3H4D7BMx23a2RnlfoOUGsiKEqahAQmLL7vGHZHPep59Ljs 43xZLHZwCK33fKKvAhVx5zRruPkqsGtbTMCtBKns6tk4Caahdb+z2OpElDa2b6V+qxp6Lk Z7AWze8mtSLPjIyTCxnDiD7jvoTKovM20Dpz6RtFx8+/JISHB80d0LQBa6NBrg== Message-ID: <1fcbaf8029f3b9f79a138d423413f625886c8415.camel@svanheule.net> Subject: Re: [PATCH v2 2/7] gpio: regmap: Add configurable dir/value order From: Sander Vanheule To: Andrew Lunn Cc: Pavel Machek , Rob Herring , Lee Jones , Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Michael Walle , Linus Walleij , Bartosz Golaszewski , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, Andy Shevchenko , linux-kernel@vger.kernel.org, Matti Vaittinen Date: Tue, 18 May 2021 13:39:12 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Tue, 2021-05-18 at 03:40 +0200, Andrew Lunn wrote: > On Mon, May 17, 2021 at 09:28:04PM +0200, Sander Vanheule wrote: > > GPIO chips may not support setting the output value when a pin is > > configured as an input > > Could you describe what happens with the hardware you are playing > with. Not being able to do this means you will get glitches when > enabling the output so you should not use these GPIOs with bit banging > busses like i2c. As I was testing this driver, I noticed that output settings for GPIO LEDs, connected to the RTL8231, weren't being properly set. The actual LED brightness didn't correspond to the one reported by sysfs. Changing the operation order fixed this. However, the vendor code uses I2C bitbanging quite extensively on these chips, so I decided to have another look. From u-boot on my device, I can manipulate the RTL8231 registeres relatively easily. I performed the following short tests: * Set pin to input, pull pin high, write output low, change direction: pin output changes to low value * Set pin to input pull pin low, write output high, change direction: pin output changes to high value Which seems to indicate that I _can_ set output values on input pins... I'll need to look into this in more detail when I have a bit more time, later this week. Best, Sander