Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2448803ybg; Fri, 5 Jun 2020 14:21:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS6MEqhPESIZ4zxTQH2CV55b8yiFmq3WKYGB5qYwP/BirobD8PKoF5zj3ppUSH0DtUBLEm X-Received: by 2002:a17:906:7f94:: with SMTP id f20mr4108585ejr.394.1591392092410; Fri, 05 Jun 2020 14:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591392092; cv=none; d=google.com; s=arc-20160816; b=XraK3ssKZl+gHtDY6FBmZ4NxptKyIfZNYacS1NxFdELF3ZXA+ojR/+GiX8LHRbL8tu lxyZFS2e0a7yxCLlq/MbVRCzO64jywBtKJ/6wZsWiCuUUJ41CDNt+TMFw7Ax3OXqzUE3 TODrH4av+5MWsRv19snv8ziM6oW6gtf5+eb6AKOEcKz+8ehPq+lPV/gYO5psD8u8RUhE fOzI3bqgCZsxq+iTR7OJXEJKp+SsnX3gzxeqATxSAkgqZe3npwyDi/muvBIo2RMIOA4C Mh77k3boafooSHp2ADysnatZ7JfQHG4LTYT0PtOQgH6YglvZYF4xJpYLwwrLArVKwwoZ L9Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wpIJ/pCsCHfvMrUjgnLtjwLHPcHaPzmZRezwzKb361g=; b=Hddr52tJLCKZQv2gCnDbtG/81718w4bICy+jSRrVvPg+ZnvDLnAWq0Xce5gxTzs3KW VNu7/5kNebue6hZkZ4nR9JJOaduk7SWsLkTosoFw0wGT2pECNAFEOTXW4M0kFtQVKqu+ QLNwxkW0PwIocwg+bncVoT3A70ebWlMoy1atN8HhacIsF5HmPrXjhQo0BdVZkGz/Zbx8 gy3UUXcJQ6GwFtJzq6JdomoXxjoxVSZ1JL/uFWg3GyCaqwBr92n8dJMCXovQcnDWhdPe m55f7jStyIyx5kbZaO2jxyWoMNytM7t1XcLstTEeY9Vv0hxMJYLnWfk1bY/1gbUOqfwN hrBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D9uEVO9p; spf=pass (google.com: 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si3955870edj.393.2020.06.05.14.21.09; Fri, 05 Jun 2020 14:21:32 -0700 (PDT) Received-SPF: pass (google.com: 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=@gmail.com header.s=20161025 header.b=D9uEVO9p; spf=pass (google.com: 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728422AbgFEVT2 (ORCPT + 99 others); Fri, 5 Jun 2020 17:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbgFEVT2 (ORCPT ); Fri, 5 Jun 2020 17:19:28 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8ACC08C5C2; Fri, 5 Jun 2020 14:19:27 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id 5so3352028pjd.0; Fri, 05 Jun 2020 14:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wpIJ/pCsCHfvMrUjgnLtjwLHPcHaPzmZRezwzKb361g=; b=D9uEVO9pBGBuM5rac9wGkOcr0GyHQpJh+pyiTwwl4iR+n8MT0M8tnX76R8O3Erohyt EgCEGnv4Mz82lsf7a9akAwu34HW2vqe7iywOWhpUtUkLfpZmBZfDKKpeROyYLIz/Q/9a rVVTBUC8cb7ary8XzT2Axnq/WuPSe3OfTb+cx54B1Sd0kslAc3h6S2iBStuNex94GU7b mDrIor/QDPWPPok3o1LPVI9hc+jsBy3DbeNpEIKujOSXLRYqUlg9Yzqck5pY8r5bnHMx KahFrX/fv73aD5HFjXluO9dCAmxd4zhpoKXGu/oj1o/ZfE0bEOXanH6mfuhV60ZDBRI6 dWIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wpIJ/pCsCHfvMrUjgnLtjwLHPcHaPzmZRezwzKb361g=; b=XdbHsrSsgW8R9qaKOQWwqVSOb4cW9DlsgIWQw8QraWHauKLTjiRrvQql30XKNURWQg COYrLaIycu4VvhhGkya14+EYAuGJmCSV54ikKruxTKJvcrO2TjJKWcURqMoNH8uvFj8j txOKipFbeac6c4GisFSMn1qGXlEYDj3BmkVcGxSWk7VZcj7kxdqE6Kf/g9FFr0QE5Rps DyPI7WFOhhZohNWjEdpr1TYHlGfUz0NxOuULrUSm9teG0xNHDIQEsxPhmUlP4hMcdT+K szYIwKbAEt5LawJCCq+oMumJD0vfeodDVBl3/gY791+Kw7h+thUVjlYjRrZS9sPGQC35 DkWw== X-Gm-Message-State: AOAM533petZ5ZCYxdAjH+wpjFwgHZ9eVHBaNQ3m0swH73hSHzR80dCKC zKZ3tBu63Yi3I8ZrdYcy1zjxGdc+f1yt3aJXgiY= X-Received: by 2002:a17:90a:1704:: with SMTP id z4mr4991653pjd.181.1591391967317; Fri, 05 Jun 2020 14:19:27 -0700 (PDT) MIME-Version: 1.0 References: <20200604211039.12689-1-michael@walle.cc> <20200604211039.12689-7-michael@walle.cc> <216db3154b46bd80202873df055bb3f3@walle.cc> <20200605131525.GK2428291@smile.fi.intel.com> In-Reply-To: From: Andy Shevchenko Date: Sat, 6 Jun 2020 00:19:10 +0300 Message-ID: Subject: Re: [PATCH v4 06/11] gpio: add support for the sl28cpld GPIO controller To: Michael Walle Cc: "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List , linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm Mailing List , Linus Walleij , Bartosz Golaszewski , Rob Herring , Jean Delvare , Guenter Roeck , Lee Jones , Thierry Reding , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mark Brown , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 5, 2020 at 9:44 PM Michael Walle wrote: > Am 2020-06-05 15:15, schrieb Andy Shevchenko: > > On Fri, Jun 05, 2020 at 02:42:53PM +0200, Michael Walle wrote: > >> Am 2020-06-05 14:00, schrieb Andy Shevchenko: > >> > On Fri, Jun 5, 2020 at 12:14 AM Michael Walle wrote: ... > >> > > + if (irq_support && > >> > > >> > Why do you need this flag? Can't simple IRQ number be sufficient? > >> > >> I want to make sure, the is no misconfiguration. Eg. only GPIO > >> flavors which has irq_support set, have the additional interrupt > >> registers. > > > > In gpio-dwapb, for example, we simple check two things: a) hardware > > limitation > > (if IRQ is assigned to a proper port) and b) if there is any IRQ comes > > from DT, > > ACPI, etc. > > I can't follow you here. irq_support is like your (a); or the > "pp->idx == 0" in your example. And you have type already. Why do you need to duplicate it? Moreover, is it protection from wrong type to have interrupts? You can move this all stuff under corresponding switch-case. > >> > > + device_property_read_bool(&pdev->dev, > >> > > "interrupt-controller")) { > >> > > + irq = platform_get_irq(pdev, 0); > >> > > + if (irq < 0) > >> > > + return irq; > >> > > + > >> > > + ret = sl28cpld_gpio_irq_init(&pdev->dev, gpio, regmap, > >> > > + base, irq); > >> > > + if (ret) > >> > > + return ret; > >> > > + > >> > > + config.irq_domain = > >> > > regmap_irq_get_domain(gpio->irq_data); -- With Best Regards, Andy Shevchenko