Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp13752268rwb; Sun, 27 Nov 2022 10:39:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LkDjzJqE43Z68JHbTfOdkvf3xR9kPGqu0FGu2F3iVjBl+kMDIubOYvmspCEj7icZYJMk0 X-Received: by 2002:a63:4b16:0:b0:476:d0b8:1117 with SMTP id y22-20020a634b16000000b00476d0b81117mr41714776pga.104.1669574354973; Sun, 27 Nov 2022 10:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669574354; cv=none; d=google.com; s=arc-20160816; b=XiBUhXmvIWHMktpiMQQt0/kiqcq93OAhxtvErN3Mjh5oE2i2g8TzB0N2YBW4MNiWVA g+tPS7Bqc9CytpCnzMOFGWcKzZxTjf5pqkV/Wb2FX+bSvM7F0yaH7pzxo8mTl6MYi52L J0881+s2SvJ1fePABC2z0NatdNZLQFNsHWhilBxS2bjh7/lNTdWJyKYmt2UZqbDos8yg 2zK0EIBFwzm2ZZH60rpbCIEwr/jHGaL/ewEWhtPOWXBXNSEUs+l8cV/h63kIFAAQj8aD MQYEJ3USMwcJuVI1Q0yEvBqH84ONUa63vDG8NWXVALgQJEB0Ga6sCGd7ICrh+BvvPQ6k cZ/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=TfHh5EwkvsEuQH9VGCwExhDOA5E7QBcDJe9jFMWQ0RI=; b=WWQKUt8L2mJ7aRkAPZ8SQt50yQN1gvFX/SO1ZlXESlv8EbhjMrtaJEYOvXqhw2hrz6 AoiO7Hq0kvesFkxjVdCCaI5kOlDzN1ayVStproRes+FVy+/Ba2pPw1aXrioZRlbPJv9u 4N0RZghOUv2TUrV3y5AJWszdjLkMaBkwqnaU20mOLIkv3e3VuH+Tk31O8UCMlwKFsIjp TqvS+CF3t8lpHMDrDj8FcGMIRbtY+HpVIRlplbTlbNuWzZvHGOw8tOkU0oV5O7kb2YTq RigotgVbvUjoSJ6arDj6PDZVMPsKrrEYFYqMqHeSOgeREJCYTrjhSwvli03C7TKY/jcV 6+ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=J4doKE8M; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 35-20020a631263000000b0046f33e14597si10077627pgs.106.2022.11.27.10.39.03; Sun, 27 Nov 2022 10:39:14 -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=@walle.cc header.s=mail2022082101 header.b=J4doKE8M; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbiK0Sby (ORCPT + 84 others); Sun, 27 Nov 2022 13:31:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiK0Sbx (ORCPT ); Sun, 27 Nov 2022 13:31:53 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4485BDF69; Sun, 27 Nov 2022 10:31:51 -0800 (PST) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 23CD811ED; Sun, 27 Nov 2022 19:31:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1669573909; 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=TfHh5EwkvsEuQH9VGCwExhDOA5E7QBcDJe9jFMWQ0RI=; b=J4doKE8Mfp8wNgXOownzniBUUunsnoQdZqOxo6ua76abg9pzeDkCXJlQ0bFR3ZqEI531QD vd+ICxZIkReyHuqsMANxXlmvvblA1wJOt9fYWodZMlC28hHktNAttAtXG314GeSNkB8DzP v+H2HLi/bnlYHWoT0DROF3oItzqOXJa7u8XSeGgNmhq1OfNd8OzNSWz4YdiZ3lUTpo2GF1 TTCa57QRlzKao21eE5jBEMf4YzdD6MI76lTbxczl/iugAar+RqfWLMpJ5sJ4OpNyFXRxu5 ZvSVIl3P3TlG0Lv3zU55H4a7L8qVAEGYHx+8BfW4ciqkNNSjvv4IasMRgqVGCg== MIME-Version: 1.0 Date: Sun, 27 Nov 2022 19:31:48 +0100 From: Michael Walle To: William Breathitt Gray Cc: Andy Shevchenko , 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 In-Reply-To: References: <80fc819bcafe9697b6e02c0750d3cf0ea4ec9e1b.1669100542.git.william.gray@linaro.org> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <3a23df35a35cdba19eeb10c75b5bca97@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Hi, [sorry this mail was just delivered now, although it seems to be sent last Tuesday.] 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 = regmap_read(map, DIO48E_DISABLE_INTERRUPT, &val); >> > + if (err) >> > + return err; >> >> Use ->init_hw() callback for this. > > 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. > > 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? Something like the following? gpiochip->init_hw = config.irq_init_hw; 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. Maybe make gpio-regmap call it on its own? But really we just connect the regmap-irq to the gpiochip irqdomain. 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(). -michael