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=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 1FBAAC433FF for ; Mon, 12 Aug 2019 16:00:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7EAB20820 for ; Mon, 12 Aug 2019 16:00:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="fYGgtyFX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbfHLQAk (ORCPT ); Mon, 12 Aug 2019 12:00:40 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37728 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725648AbfHLQAk (ORCPT ); Mon, 12 Aug 2019 12:00:40 -0400 Received: by mail-pl1-f193.google.com with SMTP id bj8so1020868plb.4 for ; Mon, 12 Aug 2019 09:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=eu4hl5qNaMJhHhWuL7T0rF5vow3jYh9xaCT/k0XYegc=; b=fYGgtyFXvcj2HnwlHoYT6g9KhiCyUBLNG62n3HsLA934ERKhjuhYqXTY11f9yY6qGW Ri9OSvrv1P5bg2kET95NS8shMfc2ZwBGOPNGDf81JO3GCrJhKzrohIwwAYe2YHXd93tY CNkMMRoBmf4uyMvTfvK+8TGl7uZnzbvN1o7Tc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=eu4hl5qNaMJhHhWuL7T0rF5vow3jYh9xaCT/k0XYegc=; b=WZgD3FE9Ze0bqjn74gV8aU6e0q9XCu+w9dMJ/aEqUCuEVoLqM0u4zdBrAAEA5QJi1T mH3ntZt03XOE+/hkQwACO/R+B+Uuj7j18pE1F7iEkbo+RmJouwkt8UFGUuJ4/WsO770r lDCUkN+xIfdVIX1neR8S21fnhqyfaSX6bHuZfTyAyyESrNTmxAU0OEerlSDwBEjJtc+4 Yuss8IaaoaT9B0EBpkIvgq/qN34J3dio6wHqPgs5B8+fIfx8DxubRBx32pMhGBkpRueb a5OdeZjzghYtasVF/m5WFPvy6YcWLFxMDS6Y0HpbZG99YmJIssAlqqqnTtgf9qbB/Vmu VqcA== X-Gm-Message-State: APjAAAVGqyT4CEk2c7yeD1dQU30AzM++Wp+1bkyJysEc7jUEk7QLSrFj oebv5G4sdLTV+fQ8s9gFvnV80w== X-Google-Smtp-Source: APXvYqyU3EltDuiGW5guVXDVBQ+lUYTTY/F8ooszBunHleKhnCrCI6OV79LHfPrQ0DhHD9nj2iePSA== X-Received: by 2002:a17:902:381:: with SMTP id d1mr32851258pld.331.1565625639711; Mon, 12 Aug 2019 09:00:39 -0700 (PDT) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id l1sm152074747pfl.9.2019.08.12.09.00.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Aug 2019 09:00:38 -0700 (PDT) Subject: Re: [PATCH] pinctrl: bcm-iproc: Pass irqchip when adding gpiochip To: Linus Walleij , linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Pramod Kumar , Ray Jui , Scott Branden , Thierry Reding References: <20190812132554.18313-1-linus.walleij@linaro.org> From: Scott Branden Message-ID: <24d28eed-c2ab-5850-50b2-db63740b71dd@broadcom.com> Date: Mon, 12 Aug 2019 09:00:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190812132554.18313-1-linus.walleij@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On 2019-08-12 6:25 a.m., Linus Walleij wrote: > We need to convert all old gpio irqchips to pass the irqchip > setup along when adding the gpio_chip. For more info see > drivers/gpio/TODO. > > For chained irqchips this is a pretty straight-forward > conversion. > > Cc: Pramod Kumar > Cc: Ray Jui > Cc: Scott Branden > Cc: Thierry Reding > Signed-off-by: Linus Walleij Acked-by: Scott Branden > --- > drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 33 ++++++++++++++---------- > 1 file changed, 19 insertions(+), 14 deletions(-) > > diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > index 18ff01727e0e..ee01306c62fa 100644 > --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > @@ -780,6 +780,25 @@ static int iproc_gpio_probe(struct platform_device *pdev) > chip->pinmux_is_supported = of_property_read_bool(dev->of_node, > "gpio-ranges"); > > + /* optional GPIO interrupt support */ > + irq = platform_get_irq(pdev, 0); > + if (irq) { > + struct gpio_irq_chip *girq; > + > + girq = &gc->irq; > + girq->chip = &iproc_gpio_irq_chip; > + girq->parent_handler = iproc_gpio_irq_handler; > + girq->num_parents = 1; > + girq->parents = devm_kcalloc(dev, 1, > + sizeof(*girq->parents), > + GFP_KERNEL); > + if (!girq->parents) > + return -ENOMEM; > + girq->parents[0] = irq; > + girq->default_type = IRQ_TYPE_NONE; > + girq->handler = handle_simple_irq; > + } > + > ret = gpiochip_add_data(gc, chip); > if (ret < 0) { > dev_err(dev, "unable to add GPIO chip\n"); > @@ -804,20 +823,6 @@ static int iproc_gpio_probe(struct platform_device *pdev) > } > } > > - /* optional GPIO interrupt support */ > - irq = platform_get_irq(pdev, 0); > - if (irq) { > - ret = gpiochip_irqchip_add(gc, &iproc_gpio_irq_chip, 0, > - handle_simple_irq, IRQ_TYPE_NONE); > - if (ret) { > - dev_err(dev, "no GPIO irqchip\n"); > - goto err_rm_gpiochip; > - } > - > - gpiochip_set_chained_irqchip(gc, &iproc_gpio_irq_chip, irq, > - iproc_gpio_irq_handler); > - } > - > return 0; > > err_rm_gpiochip: