Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp13954522rwb; Sun, 27 Nov 2022 14:47:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf7lr1fBaP9rebzIMHHPTyq8yl46KF1unyL9U8w38qhxMYMkRcyzMa18jzXIEVePwCNPF+6r X-Received: by 2002:aa7:d74c:0:b0:461:b952:8932 with SMTP id a12-20020aa7d74c000000b00461b9528932mr36914115eds.104.1669589239223; Sun, 27 Nov 2022 14:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669589239; cv=none; d=google.com; s=arc-20160816; b=XwCV9msoPCItSt4a5m4aZ4im/28wkzQ9LHTgCNKRvhUu5H/Q+yj8a3ISmDH4wB9L8p vWA3HaYxWjEW3mnGyqp2X80ITaFIi9bWAUmwKby8YmEGFqWQ6LFRvTQ7IWKKVXYXwIDn Np9nmP5Ef2pPVfXbOC4KJOfP9lFB6WUlHZSlkyStlh5EFlChOehAtcpGxOyBOhNgn/ah fwyHuLNXf5wL0G52363kxYWo6Gvd+AYqwqA9j/J6ut9mP5iTloRWaQeC+emgpHDq1j1n fDFZqlHMp8JAEx4Ai8ZuKygWfZKXO/+a0S1HmMbGNFxrrh4aeudleoNvQgRHGK4GGEle WkyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fSqT2ziZe11V4stP6hX7PoNGl+KrR2XZl2qyRP90t9E=; b=o9qB5ntSqjf4iRj+Ncjg4kTlQ5Md9L3fSONR7iZVUNNlGp1DoOCsb6mbCdJT9GK+fm FG3rFsPeoYXzd0cuFhgODZaaHKl0x75DM8StjpZOPjZMm19V+37YbK2yzpd5V1WzvCKi ruf+pQH4rDGcDhwqK9E94ZgHSHb3Po1uR5Ui2EBnZCZ6sDziykPoDGeV0APwT2WQn6uf C6aSwVqru5SH9zoSpz5Jz4wWQJWIKmOpvAI4Ggg0gRuHB3cOXojUfWgcoKPuFgMekkm9 2GVqrgisrYlXUJL6u7GILBtBXj8xpe2lVtBtpokO5XlQrWt88SeBA1F7WK2ASY+OUDfQ M7qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mRH7eCr3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy9-20020a170906fe0900b0078d4cf8de04si8878744ejb.380.2022.11.27.14.46.59; Sun, 27 Nov 2022 14:47:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mRH7eCr3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbiK0WAu (ORCPT + 84 others); Sun, 27 Nov 2022 17:00:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiK0WAq (ORCPT ); Sun, 27 Nov 2022 17:00:46 -0500 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB40DECC for ; Sun, 27 Nov 2022 14:00:44 -0800 (PST) Received: by mail-oi1-x22e.google.com with SMTP id v81so9832630oie.5 for ; Sun, 27 Nov 2022 14:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fSqT2ziZe11V4stP6hX7PoNGl+KrR2XZl2qyRP90t9E=; b=mRH7eCr3oQl29U3axHsnZy9kt+hpnjU3+26wwZzQ62fzzwq5jahhc9zoYYtexhQLp4 Zcab+JQ4eg4qnDt2gWPqVy+SagbQejlyH+Pk64fAoNjrxdbw9ol1VsanTAHv0NSuB7We QA6ZlzD7qE6cXyBTK23vdfWEAKpGzirCMGoIrQg/CSCGIUICaqjO52w5Qu+xR8bsWhuv r58TZdLCxYisjUSaYgvRlc3nO9TStlYVhvjifqEnEx7vRCR52Q4QedqEybYT5NGvODRQ Hf26M0aQxSCBj29Y2WAeIA4a2tKf7sS8/fKu4X3/i4updlPZJnpTxo+IirYeW4dIrOPK n+Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fSqT2ziZe11V4stP6hX7PoNGl+KrR2XZl2qyRP90t9E=; b=lrS8n7EwWqqWC7rCz/KfCH/T7D/a9cXDKF2QoMcaRVG5jI7eC6hKACv9QmXlYqbvhG Uy25ZV8MzAJETsmPYzpFZ4/mtrnQ2WvBT079FkTYo3T25Eppq193v8IejWnYbf91kLH1 61Okvvpx8u/p39UlTnAUbO4/3yikTq5VaXJaEN8EeNsc0Z2tKh/51zBGIQd10ZzkmM58 pkdQdwRLdm7bzG4o2cQF4tFmHYkCypyMy1Rt571uYGp6NBdctIQmXqQQLbMbNLKHmlKL jWLQ55lzrQq+p90qO1ffj2LTI1oB6bIHa7iAZvF0zCASd/gPcaNgG3b0gjWeyTbkUjBN wIyA== X-Gm-Message-State: ANoB5pmofn1kSQ4Fn92EbyJI90z5we+3F8J+cMK3Jr6wCCtb1UhADVd9 +4Wab0tEe/JAFHIbzNYuklqzu/RJ4aabcA== X-Received: by 2002:a05:6808:655:b0:35a:2e4b:4c44 with SMTP id z21-20020a056808065500b0035a2e4b4c44mr15000804oih.263.1669586443496; Sun, 27 Nov 2022 14:00:43 -0800 (PST) Received: from fedora (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id s6-20020a4ac806000000b004a05629149bsm677606ooq.17.2022.11.27.14.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Nov 2022 14:00:42 -0800 (PST) Date: Sun, 27 Nov 2022 17:00:40 -0500 From: William Breathitt Gray To: Michael Walle , Andy Shevchenko Cc: linus.walleij@linaro.org, brgl@bgdev.pl, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, broonie@kernel.org Subject: Re: [PATCH v3 3/9] gpio: 104-dio-48e: Migrate to the regmap-irq API Message-ID: References: <80fc819bcafe9697b6e02c0750d3cf0ea4ec9e1b.1669100542.git.william.gray@linaro.org> <3a23df35a35cdba19eeb10c75b5bca97@walle.cc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s3ya4vK15ghsrGGf" Content-Disposition: inline In-Reply-To: <3a23df35a35cdba19eeb10c75b5bca97@walle.cc> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --s3ya4vK15ghsrGGf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 27, 2022 at 07:31:48PM +0100, Michael Walle wrote: > Hi, >=20 > [sorry this mail was just delivered now, although it seems > to be sent last Tuesday.] Actually I just sent it today, but you're right that it seems to have a date of last Tuesday, so I must have configured something wrong on my end before I sent it (sorry). >=20 > Am 2022-11-22 11:29, schrieb William Breathitt Gray: > > On Wed, Nov 23, 2022 at 05:01:53PM +0200, Andy Shevchenko wrote: > > > On Tue, Nov 22, 2022 at 02:11:00AM -0500, William Breathitt Gray > > > wrote: > > > > + /* Initialize device interrupt state */ > > > > + err =3D regmap_read(map, DIO48E_DISABLE_INTERRUPT, &val); > > > > + if (err) > > > > + return err; > > >=20 > > > Use ->init_hw() callback for this. > >=20 > > In a subsequent patch 7/9 we remove direct gpio_chip registration in > > favor of the i8255 library registration via gpio_regmap. It doesn't look > > like gpio_regmap_register() sets the init_hw() callback. > >=20 > > Michael, do you see any issues if I introduce init_hw() to > > gpio_regmap_config? Or do you think this IRQ initialization belongs > > somewhere else? >=20 > Something like the following? > gpiochip->init_hw =3D config.irq_init_hw; >=20 > gpiochip doesn't seem to be the correct place, gpiochip_add_irqchip() > is a noop for gpio-regmap, right? So using gpiochip_irqchip_init_hw() > seems wrong. >=20 > Maybe make gpio-regmap call it on its own? But really we just connect > the regmap-irq to the gpiochip irqdomain. I think you're right, it feels strange to handle IRQ initialization via the GPIO framework. Maybe somewhere in regmap_irq might be more appropriate? > What is the purpose of the > .init_hw callback? I've looked at other drivers which use regmap-irq > and they all seem to just initialize the hardware in their _probe(). >=20 > -michael I'm not opposed to initializing the hardware in _probe(), although I can see merit in pushing that operation instead closer to the framework where the initialization is actually relevant. Andy, maybe you can shed some light about .init_hw; I think you introduced it to gpiolib in commit 9411e3aaa6342. William Breathitt Gray --s3ya4vK15ghsrGGf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCY4PeCAAKCRC1SFbKvhIj K73/AQD/c/ICZCQAd1nYvZNfmkfuslnbIWNQbkV2Pcv+42hzUQEAjZsetUe8+/Ox 38xhXR0oZQabGUoopQu3g0lelfpQqwg= =vrdf -----END PGP SIGNATURE----- --s3ya4vK15ghsrGGf--