Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp142224ybz; Wed, 15 Apr 2020 06:07:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJCj+D4qN6W4if1GGA4stdjRtMbvcftwsq7fO1j33samed59+9Z+jReO2dM3k7L+HR7Lgz0 X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr24835650edv.217.1586956032686; Wed, 15 Apr 2020 06:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586956032; cv=none; d=google.com; s=arc-20160816; b=EW3TpQNwFM5jKdsPs9g330RW+be8Ls83g6q0i6Cpjc3prYMV2CIqwBrq4VbHepkvC9 chec/fDV/bxcExtDu4jyLI3GTVxLAO5+S5JjDM+N0+j8NzqLXwYaheWv7oqGBZpvnWlF JKhLSu7xzi+FDIkLJJyadNimo73nJrzctLG6vJwsAtGNIHcPCJzga6TojAd4zPCpFyz2 QEFgzszvrZIiHIsAK6VrbM8rGLIvZ/1YvMuacXWj4r+1qMH1aUtdBcMQf1NHYZD7M9+L ji1b3lXSvT0LdtKI3SRupkST7LKIeFAqvOWn2Kg+KJdTkm5pNucpzphFz2QI1fgq3d/q XAEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KVdJf99oBePJeiG7eadpNnS6AJcJY46SD9/08/RpYY4=; b=FpgR1LNU+fD5C3Xb1tc4dHgxBAPFn1cjznFCd9pHSIbDU529z0+TU2T+83BbQx7Opk JhVR7hzvsFKjeCjUEg1bvwxkbJRKMnUT1ytB5u8vK1MPwa6oqFLbMrZWqiaA7b5B6Nx0 +0mGhmAGjXuVjXwoy2SYqj3sg7Bi0OYLPuOs3kBBgSceBVOsSdv8dljUhJOQF0Vj6s3G n+yUwy0LFykzdWSVTQQOCIFrYZ8ggf7HPQkb68P2DlKBI62BhWI4vOLYYos8FTqEeaJN nEsl92TcouyAJS3nLEDkuIgFAPMTEtgXJw1nqyA/Z5Tkdxnj6PZmxG4zLQupKV47ewkP 31dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ww0nYJB4; spf=pass (google.com: best guess record for 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si10729074edw.34.2020.04.15.06.06.47; Wed, 15 Apr 2020 06:07:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=@kernel.org header.s=default header.b=ww0nYJB4; spf=pass (google.com: best guess record for 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504125AbgDNSj0 (ORCPT + 99 others); Tue, 14 Apr 2020 14:39:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:33860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504116AbgDNSjY (ORCPT ); Tue, 14 Apr 2020 14:39:24 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 030CD2076C; Tue, 14 Apr 2020 18:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586889563; bh=P4rgnvp+ubvr6gQQwx96f5n8r83/w0mRlcAt7NxMf1Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ww0nYJB4QPCYiyCRxxrz3MhjaV8MiazOYKP+JMlOoHG2mbl+ChLoBBcrOipv2bynr B20L1Mj7Hi2EyxZG0mfBSrEA+lwtlYNctnTC7UWNAjwpWou1DgNqwMLKtwb2+q7N60 usjUjbY8yBBBG0upAxAMQXtDr65r+D74Qk8q/NYI= Date: Tue, 14 Apr 2020 19:39:21 +0100 From: Mark Brown To: Michael Walle Cc: Bartosz Golaszewski , linux-gpio , linux-devicetree , LKML , linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, LINUXWATCHDOG , arm-soc , Linus Walleij , Rob Herring , Jean Delvare , Guenter Roeck , Lee Jones , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc Zyngier , Greg Kroah-Hartman Subject: Re: [PATCH v2 10/16] gpio: add a reusable generic gpio_chip using regmap Message-ID: <20200414183921.GN5412@sirena.org.uk> References: <20200402203656.27047-1-michael@walle.cc> <20200402203656.27047-11-michael@walle.cc> <80bd8661ec8a1f5eda3f09a267846eaa@walle.cc> <20200414172129.GJ5412@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uWbmMdDzzl2TXAgx" Content-Disposition: inline In-Reply-To: X-Cookie: I've only got 12 cards. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --uWbmMdDzzl2TXAgx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 14, 2020 at 08:36:23PM +0200, Michael Walle wrote: > Am 2020-04-14 19:21, schrieb Mark Brown: > > You could define REGMAP_INVALID_ADDR to be (unsigned int)(-1) or some > > other suitably implausible address and use that as a value. It's > > possible that there might be a collision with a real address on some > > device but it should be sufficiently unlikely to be useful, especially > > if it's not something regmap in general goes and evaluates. For extra > > safety we could have an API for allowing users to query the register > > validity information regmap has (or can be given) and gpiolib could then > > use that to figure out if the value was actually a dummy value but > > that's probably overdoing it. > If possible, I'd like to have the opposite logic. That is, if it is not > set it should be invalid. If we have a magic macro like > REGMAP_INVALID_ADDR, we must assign it to all the unused addresses. Thus > every driver would have to assign all addresses and if in the future > there will be some added, we'd have to touch all the drivers which use > gpio_regmap. Sure, for that you'd need a separate flag since zero is such a commonly valid address. --uWbmMdDzzl2TXAgx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl6WA1gACgkQJNaLcl1U h9BAjwf/bIsieXPSNQdoyPsGYQ4OjkmRX200mVnxW9V8WW1aT87hmD5XwdcUz27T 0oXCpdsy7VDE5l4T7iDCXzXW1++aQW/mOE7MW7fgfDLWe212XUBcKluVTQ77+1wo z8FEPPjTRReUzy4LyvEtOuPv8S/wEeHOaPxuyOhhNacw5Sa/Wrmoj3UJRsUzB/MG Cm0W3nRmAIw1VeyMwP89BNeTXYdbqUojlBRj5DZRhXziF7L6YyLe8nMH3ZN+JOq7 Od3cD4VROPQ3xfDaeCEG8QsoHSwZXYG+2kF7DjgWvC7zliuISkElPje0uK2KEHHJ aaGR4e5qeBL5Nha6oy2QwhRMN1Fezw== =I4w+ -----END PGP SIGNATURE----- --uWbmMdDzzl2TXAgx--