Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5451083imm; Sat, 19 May 2018 02:20:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZobIpxnVZOzjmXRyHJei2jZOyJQKas/UcgvKTDcxmTu00BWXId8yvIoQVgL9IKk004PAyzw X-Received: by 2002:a63:7a5a:: with SMTP id j26-v6mr2201655pgn.421.1526721646648; Sat, 19 May 2018 02:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526721646; cv=none; d=google.com; s=arc-20160816; b=grpubS73b5qCkfJD8qUsqICTFrK5/BR7xpWwiPCbYrTl4M6pqBm0WhOMlBwU56rqRb N/E85JZ6Z7QvW5oGuOf0lipZu8ZORX4tuSRvjALlIoZkALAkOmPuHZ4cmM+iobteTIGe TnLmUdH6Cx7xO7IPwkhfdBmWhcCTN2YdsIXt2liQ4vRQGB5EYIXCMGe/ZDUUzAAJpttw e7yFQdOYNIVkQ6qHNECMI3m7Xp7JL8/hYfJMpnUwhF83YlBd5i2ntUJbZ2IQ+J8CUXBQ WXh+sq2BxoNa4REXToitVPYs3hfLyYDKES3616/tpF6HOoDrAZTKzPRnKUD0n5SZ8R8G Loeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=oS391mQTNkrgVH79lt5vSH+U6DiUq4OObxjOe8pcfsg=; b=kCbJw40h019xtCAG9mPuiUmU8la5jwpXHVshMQyjlT+N2iqXvny6T+M6WfgJYjm8eS 3qyZjAB9FD0/cHjaGeMkXqVJsS951iFEh0G700cr0qCvewfKaKo5vVhikEDLu9EmlL8f lkqkgdlHBg3V1gWOyaMjJlZMxcI299m7J9A2TtcpbGFdlLiJnrUBeRUawwlXdhucn655 lgcS9izfGUdxYFJdKP5mGXLsCZaANlmBU9z3BXoQtM+kmOSTgmKDm/0tw4i7Q7/gexzU iHpgMuvH/eSyuE++wALtx0dyhS9VhOLhDZr9ZJpLDkNgQUoEUxBIgGgNhMPKq8NOdlzx Y8sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sm515TY3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si9116686plj.86.2018.05.19.02.19.59; Sat, 19 May 2018 02:20:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sm515TY3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1752255AbeESJTB (ORCPT + 99 others); Sat, 19 May 2018 05:19:01 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50678 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbeESJS5 (ORCPT ); Sat, 19 May 2018 05:18:57 -0400 Received: by mail-wm0-f66.google.com with SMTP id t11-v6so17847044wmt.0; Sat, 19 May 2018 02:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oS391mQTNkrgVH79lt5vSH+U6DiUq4OObxjOe8pcfsg=; b=Sm515TY3erlWjceEmlEHU/Pefk+nENCV0Um7Qww6eByxge9nHA7I4jgdLdZylPaN3/ p5wEssFQCnrZBIpyBSMy82ZNDrWwLEt3PE4R4k44CFpi8V8X3A50xQiKQirnjfBqPu4u uLgquJuQfCgVHhSGCbLZPWXLvKzLe+z9ZIeFbtZF5Il6fVKSl6bO8IDxzrFnRvxSKWaS ncf5EX3b4bkn57JRgQtzWCOgSabcdT7Y2rxVojS3vtZ8NqHKAGuRu253Bu5QEJuWH6uO F9dPvEfv5o9Yehy0RtZaLGnaRxtW1IeTL7Hr9YoW8OpFTDJIvRb/4lfrqimFFih0mXJz r0lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oS391mQTNkrgVH79lt5vSH+U6DiUq4OObxjOe8pcfsg=; b=BZ3hePbD7GZH1kKgCp70fvU4K487WYFUk+EBOK0bDZPXvuhBF8a9duPpkbziWv0Mhb zr5H1KVR2OdM8FrWmrNA2O0z3vftJC/b+/k2acSe5WfqoxPlvqsxAyJIqAtQjuoR+Xvp 0kW2f63zBFAqVYhdd5Si0tXEPCRkV+5lUerwM6gssmLHU5nWvY4LgAbrrz0E4qikaesv FlvCKCOEhEixsNkCNMowjx4PE6d1khdJhRZWy/TPQVp0RVM/iM+P1/5B+zCWT3+Io9e5 9bhqxZzO6eF8/E5kjw3YNKcHCDB3m5nUHhqqjg3kp0W2bP5Iek9AGp41gSC8tRDXfBz/ aXJg== X-Gm-Message-State: ALKqPwePihwBvW7VW2kuypL2fIHiGUj352xY83JQQA8e3zlkA2mPHbpa n0Jocp3nXnbjZcX/11GXZ58gB/IsohA= X-Received: by 2002:a1c:6503:: with SMTP id z3-v6mr6061029wmb.11.1526721535302; Sat, 19 May 2018 02:18:55 -0700 (PDT) Received: from debian64.daheim (p4FD0988C.dip0.t-ipconnect.de. [79.208.152.140]) by smtp.gmail.com with ESMTPSA id n71-v6sm10816231wmi.14.2018.05.19.02.18.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 May 2018 02:18:54 -0700 (PDT) Received: from localhost.daheim ([127.0.0.1] helo=debian64.localnet) by debian64.daheim with esmtp (Exim 4.91) (envelope-from ) id 1fJy0r-000262-Gc; Sat, 19 May 2018 11:18:53 +0200 From: Christian Lamparter To: Manivannan Sadhasivam Cc: linus.walleij@linaro.org, robh+dt@kernel.org, afaerber@suse.de, liuwei@actions-semi.com, mp-cs@actions-semi.com, 96boards@ucrobotics.com, devicetree@vger.kernel.org, andy.shevchenko@gmail.com, daniel.thompson@linaro.org, amit.kucheria@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, hzhang@ucrobotics.com, bdong@ucrobotics.com, manivannanece23@gmail.com Subject: Re: [PATCH 4/5] pinctrl: actions: Add gpio support for Actions S900 SoC Date: Sat, 19 May 2018 11:18:53 +0200 Message-ID: <12834501.5lBvNSZm06@debian64> In-Reply-To: <20180518023056.7869-5-manivannan.sadhasivam@linaro.org> References: <20180518023056.7869-1-manivannan.sadhasivam@linaro.org> <20180518023056.7869-5-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, May 18, 2018 4:30:55 AM CEST Manivannan Sadhasivam wrote: > Add gpio support to pinctrl driver for Actions Semi S900 SoC. > > Signed-off-by: Manivannan Sadhasivam > --- > [...] > +static int owl_gpio_init(struct owl_pinctrl *pctrl) > +{ > + struct gpio_chip *chip; > + int ret; > + > + chip = &pctrl->chip; > + chip->base = -1; > + chip->ngpio = pctrl->soc->ngpios; > + chip->label = dev_name(pctrl->dev); > + chip->parent = pctrl->dev; > + chip->owner = THIS_MODULE; > + chip->of_node = pctrl->dev->of_node; > + > + ret = gpiochip_add_data(&pctrl->chip, pctrl); > + if (ret) { > + dev_err(pctrl->dev, "failed to register gpiochip\n"); > + return ret; > + } > + > + ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), > + 0, 0, chip->ngpio); > + if (ret) { > + dev_err(pctrl->dev, "failed to add pin range\n"); > + gpiochip_remove(&pctrl->chip); > + return ret; > + } > + gpiochip_add_pin_range()? That's not going to work with gpio-hogs. But, you can easily test this. Just add a gpio-hog [0] ( Section 2. gpio-controller nodes) into the Devicetree's pinctrl node. something like: (No idea if GPIO1 is already used, but any free gpio will do) | [...] | pinctrl@e01b0000 { | compatible = "actions,s900-pinctrl"; | reg = <0x0 0xe01b0000 0x0 0x1000>; | clocks = <&cmu CLK_GPIO>; | gpio-controller; | #gpio-cells = <2>; | | line_b { | gpio-hog; | gpios = <1 GPIO_ACTIVE_HIGH>; | output-low; | line-name = "foo-bar-gpio"; | }; | }; The pinctrl probe will fail. You can fix this by replacing the gpiochip_add_pin_range() and use the gpio-ranges [0] property to define the range. [0]