From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65FACC5519A for ; Mon, 27 Apr 2020 11:45:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F77A206B6 for ; Mon, 27 Apr 2020 11:45:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgD0LpP (ORCPT ); Mon, 27 Apr 2020 07:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727001AbgD0LpO (ORCPT ); Mon, 27 Apr 2020 07:45:14 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC26C0610D5; Mon, 27 Apr 2020 04:45:14 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jT2C4-0001Mi-Mv; Mon, 27 Apr 2020 13:45:00 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 1C40E100606; Mon, 27 Apr 2020 13:45:00 +0200 (CEST) From: Thomas Gleixner To: Michael Walle , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Bartosz Golaszewski , Rob Herring , Jean Delvare , Guenter Roeck , Lee Jones , Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Jason Cooper , Marc Zyngier , Mark Brown , Greg Kroah-Hartman , Michael Walle Subject: Re: [PATCH v3 11/16] gpio: add support for the sl28cpld GPIO controller In-Reply-To: <20200423174543.17161-12-michael@walle.cc> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-12-michael@walle.cc> Date: Mon, 27 Apr 2020 13:45:00 +0200 Message-ID: <87k121qhj7.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Michael Walle writes: > +struct sl28cpld_gpio { > + struct regmap_irq_chip irq_chip; > + struct regmap_irq_chip_data *irq_data; > +}; > + > +static const struct regmap_irq sl28cpld_gpio_irqs[] = { > + REGMAP_IRQ_REG_LINE(0, 8), > + REGMAP_IRQ_REG_LINE(1, 8), > + REGMAP_IRQ_REG_LINE(2, 8), > + REGMAP_IRQ_REG_LINE(3, 8), > + REGMAP_IRQ_REG_LINE(4, 8), > + REGMAP_IRQ_REG_LINE(5, 8), > + REGMAP_IRQ_REG_LINE(6, 8), > + REGMAP_IRQ_REG_LINE(7, 8), > +}; This is exactly the same as the one in the irq chip patch. > +static int sl28cpld_gpio_irq_init(struct device *dev, > + struct sl28cpld_gpio *gpio, > + struct regmap *regmap, unsigned int base, > + int irq) > +{ > + struct regmap_irq_chip *irq_chip = &gpio->irq_chip; > + > + irq_chip->name = "sl28cpld-gpio-irq", > + irq_chip->irqs = sl28cpld_gpio_irqs; > + irq_chip->num_irqs = ARRAY_SIZE(sl28cpld_gpio_irqs); > + irq_chip->num_regs = 1; > + irq_chip->status_base = base + GPIO_REG_IP; > + irq_chip->mask_base = base + GPIO_REG_IE; > + irq_chip->mask_invert = true, > + irq_chip->ack_base = base + GPIO_REG_IP; > + > + return devm_regmap_add_irq_chip_np(dev, dev_of_node(dev), regmap, > + irq, IRQF_SHARED | IRQF_ONESHOT, 0, > + irq_chip, &gpio->irq_data); > +} And this looks pretty familiar as well. What's the point of duplicating that code? Thanks, tglx From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: Re: [PATCH v3 11/16] gpio: add support for the sl28cpld GPIO controller Date: Mon, 27 Apr 2020 13:45:00 +0200 Message-ID: <87k121qhj7.fsf@nanos.tec.linutronix.de> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-12-michael@walle.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200423174543.17161-12-michael@walle.cc> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane-mx.org@lists.infradead.org To: Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Jean Delvare , Jason Cooper , Greg Kroah-Hartman , Shawn Guo , Linus Walleij , Li Yang , Bartosz Golaszewski , Michael Walle , Rob Herring , Thierry Reding , Mark Brown , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Wim Van Sebroeck , Lee Jones , Guenter Roeck List-Id: linux-pwm@vger.kernel.org Michael Walle writes: > +struct sl28cpld_gpio { > + struct regmap_irq_chip irq_chip; > + struct regmap_irq_chip_data *irq_data; > +}; > + > +static const struct regmap_irq sl28cpld_gpio_irqs[] = { > + REGMAP_IRQ_REG_LINE(0, 8), > + REGMAP_IRQ_REG_LINE(1, 8), > + REGMAP_IRQ_REG_LINE(2, 8), > + REGMAP_IRQ_REG_LINE(3, 8), > + REGMAP_IRQ_REG_LINE(4, 8), > + REGMAP_IRQ_REG_LINE(5, 8), > + REGMAP_IRQ_REG_LINE(6, 8), > + REGMAP_IRQ_REG_LINE(7, 8), > +}; This is exactly the same as the one in the irq chip patch. > +static int sl28cpld_gpio_irq_init(struct device *dev, > + struct sl28cpld_gpio *gpio, > + struct regmap *regmap, unsigned int base, > + int irq) > +{ > + struct regmap_irq_chip *irq_chip = &gpio->irq_chip; > + > + irq_chip->name = "sl28cpld-gpio-irq", > + irq_chip->irqs = sl28cpld_gpio_irqs; > + irq_chip->num_irqs = ARRAY_SIZE(sl28cpld_gpio_irqs); > + irq_chip->num_regs = 1; > + irq_chip->status_base = base + GPIO_REG_IP; > + irq_chip->mask_base = base + GPIO_REG_IE; > + irq_chip->mask_invert = true, > + irq_chip->ack_base = base + GPIO_REG_IP; > + > + return devm_regmap_add_irq_chip_np(dev, dev_of_node(dev), regmap, > + irq, IRQF_SHARED | IRQF_ONESHOT, 0, > + irq_chip, &gpio->irq_data); > +} And this looks pretty familiar as well. What's the point of duplicating that code? Thanks, tglx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C66E3C54FD0 for ; Mon, 27 Apr 2020 11:45:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6E45B2063A for ; Mon, 27 Apr 2020 11:45:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pT90mHvP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E45B2063A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8evafKWvVlnCXWrCd+vxEc/cOeXGZWHyylH082GmODg=; b=pT90mHvP+zr78G BERxkJ7RmDKYKHIjomrDiIrl2eEjpUBEHNnNacVpB40qoPwA3eQgfvPS3qaq6HGtDR3QZ10/dVJlz C2I7zeB7eXSJncDg5YoEWhL71QIohqR7PNYtO2i5aGIFp7KYquwfYjcSSXxxPIb05nar5maA3cMiS 5ff/VxQeySIIYMfshQlNqjjgffSbu6UoKX0AJgQFx312FP3H6jqMB849The+A2sGvUBZVoGjGbRLf 0qcGr5qa/1TSJzuAal7hiL3IHh5v5J3oJ/hr7Rtf3r9GMOSFIL3xm7og1Nw+ZYgf2iLEkjDtSgaZx XEE0Owc+f8412ne8WA5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT2CD-0007yx-MU; Mon, 27 Apr 2020 11:45:09 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT2CA-00078j-Kn for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 11:45:08 +0000 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jT2C4-0001Mi-Mv; Mon, 27 Apr 2020 13:45:00 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 1C40E100606; Mon, 27 Apr 2020 13:45:00 +0200 (CEST) From: Thomas Gleixner To: Michael Walle , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 11/16] gpio: add support for the sl28cpld GPIO controller In-Reply-To: <20200423174543.17161-12-michael@walle.cc> References: <20200423174543.17161-1-michael@walle.cc> <20200423174543.17161-12-michael@walle.cc> Date: Mon, 27 Apr 2020 13:45:00 +0200 Message-ID: <87k121qhj7.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_044506_842657_B384E8AB X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Jean Delvare , Jason Cooper , Greg Kroah-Hartman , Shawn Guo , Linus Walleij , Li Yang , Bartosz Golaszewski , Michael Walle , Rob Herring , Thierry Reding , Mark Brown , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Wim Van Sebroeck , Lee Jones , Guenter Roeck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Michael Walle writes: > +struct sl28cpld_gpio { > + struct regmap_irq_chip irq_chip; > + struct regmap_irq_chip_data *irq_data; > +}; > + > +static const struct regmap_irq sl28cpld_gpio_irqs[] = { > + REGMAP_IRQ_REG_LINE(0, 8), > + REGMAP_IRQ_REG_LINE(1, 8), > + REGMAP_IRQ_REG_LINE(2, 8), > + REGMAP_IRQ_REG_LINE(3, 8), > + REGMAP_IRQ_REG_LINE(4, 8), > + REGMAP_IRQ_REG_LINE(5, 8), > + REGMAP_IRQ_REG_LINE(6, 8), > + REGMAP_IRQ_REG_LINE(7, 8), > +}; This is exactly the same as the one in the irq chip patch. > +static int sl28cpld_gpio_irq_init(struct device *dev, > + struct sl28cpld_gpio *gpio, > + struct regmap *regmap, unsigned int base, > + int irq) > +{ > + struct regmap_irq_chip *irq_chip = &gpio->irq_chip; > + > + irq_chip->name = "sl28cpld-gpio-irq", > + irq_chip->irqs = sl28cpld_gpio_irqs; > + irq_chip->num_irqs = ARRAY_SIZE(sl28cpld_gpio_irqs); > + irq_chip->num_regs = 1; > + irq_chip->status_base = base + GPIO_REG_IP; > + irq_chip->mask_base = base + GPIO_REG_IE; > + irq_chip->mask_invert = true, > + irq_chip->ack_base = base + GPIO_REG_IP; > + > + return devm_regmap_add_irq_chip_np(dev, dev_of_node(dev), regmap, > + irq, IRQF_SHARED | IRQF_ONESHOT, 0, > + irq_chip, &gpio->irq_data); > +} And this looks pretty familiar as well. What's the point of duplicating that code? Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel