From patchwork Sat Jun 23 04:59:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 139746 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1637480lji; Fri, 22 Jun 2018 22:00:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJTEDiZzivJhFhyCk4jKIz8Muy4u8baMBcmQhORZFuKk2TLIBWyKuxNNlLXsrVNsFEaWoCX X-Received: by 2002:a65:508d:: with SMTP id r13-v6mr3694285pgp.143.1529730038142; Fri, 22 Jun 2018 22:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529730038; cv=none; d=google.com; s=arc-20160816; b=W9xDK9peaeYzXiSa0cxMDFkI656UncYGgZNWztmJP9Zn55qPt5HIQAlxRJPgXncype ASDJOMpElVS1zOZLsD8HaAp7t8fxdyN3sBsjYM/4sX8Uf3r6cy+zTTNYLrZM5M/i0fKB le9L6al2eyGSj556rAiyUtZlR+GU2vrmTzDC5R2/KeeGHW1NM/M2LBCEIJLxjrtpUFVT BBWwKhWCq9VrvKSpg5AcKgn+rTcdYL6SLWg9SkiR30bt3aCvnqeRSQ10NdrUyAog42Vb b+9g+50GEWWGXVfac/zwpr6GJu4bOPj/HkxhnVeuNNXKkMqwjVqHwC6rsClfi3rzvUnB j4PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eCGpJN+Du2K06bSnc1x9wpfp8uLy1lBlRT3RJhDL9yc=; b=nj5C3qNTKpczftLk5RVFcX9RZApQHINNDwUjWmZgGlImpnVZXngpn4VnXYo+zdmx3a 7E4R493aEf4DAOFA2Fbmx+YzHyfnf57BUhuHDnaiAPrKKffcG9mJQC+FS77FqOUwNFH6 rP98rYAakV48rS0bqDXrAMtn7n1wjvmnk7mCjJhs5U9s7ZkA80MWmhDZtWvj8FUW6zEp cMC2XbmKmilqKnvqoOt+H4XaJ6mQ58TVpCK37P88UErDLqMuslm5uGgnZUk4/+Qs4RuD PE7aeYfGx0nyZXOskPMw1G8Ls5V6+EA35QXL+Ov6FzH/VWimnV3BkXIY2vKccT4p43j8 flGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b+1+EBws; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g67-v6si9263678plb.73.2018.06.22.22.00.37; Fri, 22 Jun 2018 22:00:38 -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=@linaro.org header.s=google header.b=b+1+EBws; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506AbeFWFAe (ORCPT + 31 others); Sat, 23 Jun 2018 01:00:34 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36440 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbeFWFAa (ORCPT ); Sat, 23 Jun 2018 01:00:30 -0400 Received: by mail-pf0-f194.google.com with SMTP id u16-v6so332655pfh.3 for ; Fri, 22 Jun 2018 22:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eCGpJN+Du2K06bSnc1x9wpfp8uLy1lBlRT3RJhDL9yc=; b=b+1+EBws9kcF+NRXDbNQJbAylaYtNyBnLOgfICtWlq3WjC/WUSMrSsu5SRliaE4VhZ Ty81kFCWB1VHY7rRfVNgz/1PZYJ/16LycDgcMnyDNATRnqfxLiUm+Lmwj4t6ck8WZG3h 3zsbEuxPla7V4XF3SCHJaO0R0atyfPPjimGJo= 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; bh=eCGpJN+Du2K06bSnc1x9wpfp8uLy1lBlRT3RJhDL9yc=; b=uXUl+ZwrJFa82JCEshb/o8Y+nl0DJzFrbOcW+EPOsrjRxeLJfk+ifu8vKG/qHI9Ybh pM0QHY/0O/PnLWU/gEJOPQjHNBxJ2XI2kNxo16O69nbv2PAJ9fsu8W7f+1UzJBVoCpkh E02qD6g0hqblK+XQ/nlChik83QutL6/1jI3AsfyGHtrXZIZOoL4X4JGxX+dWCoYB9xEf nQDAOBAkrhZEaSddCJrgqMvpADZXeirnxPTcEs3eB4/XjMIPnKs4w+H4aApBX1JHa6rZ T5/nYENBZ8kLL91n52LYvskJGceIkn/34yDDziU+XRQk/Rx17bmR0a0YQjWYE08bhWHa HAsA== X-Gm-Message-State: APt69E1oUCQiPYYNXwx37ZHN73vtg5wgY3CP5K3eU3VKl1HWjQdNs1HB Zpkje5KTTBoa7IyxIVe/8fB6 X-Received: by 2002:a62:4d01:: with SMTP id a1-v6mr4440836pfb.144.1529730029606; Fri, 22 Jun 2018 22:00:29 -0700 (PDT) Received: from localhost.localdomain ([2405:204:70c3:aca:6549:5166:32c7:2dab]) by smtp.gmail.com with ESMTPSA id y14-v6sm10787603pgv.37.2018.06.22.22.00.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 22:00:29 -0700 (PDT) From: Manivannan Sadhasivam To: linus.walleij@linaro.org, robh+dt@kernel.org, afaerber@suse.de Cc: 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, thomas.liau@actions-semi.com, jeff.chen@actions-semi.com, Manivannan Sadhasivam Subject: [PATCH v2 1/3] dt-bindings: pinctrl: Add gpio interrupt bindings for Actions S900 SoC Date: Sat, 23 Jun 2018 10:29:52 +0530 Message-Id: <20180623045954.6729-2-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180623045954.6729-1-manivannan.sadhasivam@linaro.org> References: <20180623045954.6729-1-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add gpio interrupt bindings for Actions Semi S900 SoC. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring --- .../bindings/pinctrl/actions,s900-pinctrl.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/pinctrl/actions,s900-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/actions,s900-pinctrl.txt index 8fb5a53775e8..81b58dddd3ed 100644 --- a/Documentation/devicetree/bindings/pinctrl/actions,s900-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/actions,s900-pinctrl.txt @@ -19,6 +19,10 @@ Required Properties: defines the interrupt number, the second encodes the trigger flags described in bindings/interrupt-controller/interrupts.txt +- interrupts: The interrupt outputs from the controller. There is one GPIO + interrupt per GPIO bank. The number of interrupts listed depends + on the number of GPIO banks on the SoC. The interrupts must be + ordered by bank, starting with bank 0. Please refer to pinctrl-bindings.txt in this directory for details of the common pinctrl bindings used by client devices, including the meaning of the @@ -180,6 +184,12 @@ Example: #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + interrupts = , + , + , + , + , + ; uart2-default: uart2-default { pinmux { From patchwork Sat Jun 23 04:59:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 139747 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1637565lji; Fri, 22 Jun 2018 22:00:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKL2GDvjQVntAgvkLBJ85mClhGLBkz9exjXcRe62RZxEUuN3nAwCBmC2lbx1s7ft+xE6Tdc X-Received: by 2002:a17:902:900a:: with SMTP id a10-v6mr4250099plp.41.1529730044450; Fri, 22 Jun 2018 22:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529730044; cv=none; d=google.com; s=arc-20160816; b=Mus8zYog3LlHIhEqjuYXqj94/tYetnSd4B8yb4q/vOydp1kr4GnlY+WR46Sg5/zTRh 4SX89pNTwnE9bI4Gh1PTneuVF2UIfZmSsKRq1UtdN1vpc4iv/cOF6hMQ5IUOOnO81DRs qlNZ+myFJFesiUdCCMHA80cFtMASeqyOvw19Jill+V70XCdHULfy8SePiCRIYER0hG4q oB9M0CjBA2LL3rpXPHo1A3kc0OMY78oUbwIh8bnNz6VQoq9sNiL3rFZtH/Q/TE2rJFT1 Gsz3ieorKuI5yMxOadrmwHDCyArd6zXaa1n/3ZrY9DzxifBY/ps19cXkE+kHJq8wkrf1 +TAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=dLCqypfp2r8AtJ6hMHpArJX54Bn4+lTKKs0nDLyZBDY=; b=lBmkYgEWcilemv0Q4K1OJ3RVK8T3ZbaPJt3YT/3rYgr3fofWcaMIt0lei3nEm2hYUf s9BamVvf7xmw4hWQoUVheDDm2OPSq7mEyb2IrPGN16RydCzCN/wnILHTn+HPsfPEjZzr fAJITZHmzsgcJ2xWuEXQ9AAKcfHPnAaXya28OcuZVzAL1tqTsLfYqMhrVYqZ4tH/Dkof aBryajEoD+tgT6aBL6TNcYiv0Hu86GbfMwnMIsSC3k8EfbPcSdrUkRUR7mxTjjawRoTD 6L0d+xNU3pAattOIVcQrYJFd2Ml99MkG6mXLP1RJhda0LCJbAS4zFd9MYNPAQVMvzhNn 2f+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aBujvk14; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8-v6si8937780plr.422.2018.06.22.22.00.44; Fri, 22 Jun 2018 22:00:44 -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=@linaro.org header.s=google header.b=aBujvk14; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751540AbeFWFAm (ORCPT + 31 others); Sat, 23 Jun 2018 01:00:42 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40604 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbeFWFAj (ORCPT ); Sat, 23 Jun 2018 01:00:39 -0400 Received: by mail-pf0-f193.google.com with SMTP id z24-v6so4100125pfe.7 for ; Fri, 22 Jun 2018 22:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dLCqypfp2r8AtJ6hMHpArJX54Bn4+lTKKs0nDLyZBDY=; b=aBujvk14pMuyo20jIloc3GKOS9yJyMs0btOnsrSdW/ht/xdZndnxZB93Ns9loZ1OXL w71pONmdk3clHFbAcka6SAi4TUbLYdR03X281NMcgutTRD63OsSCUFO2MshY3JdFC4Z5 Fmp5N3JSjFyq/4Ei0D6CdtB2wOKEw2N092kDE= 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; bh=dLCqypfp2r8AtJ6hMHpArJX54Bn4+lTKKs0nDLyZBDY=; b=ssRqcns3VU+oOJANPOPPO5bl7J0ArH/Nd2WXG4SdWuCW4tZ29s0FxQgYSyEpAADBmJ 4iC9LcPVlnRXXUzAEfZchT6KKhDgIG+HpPu40WVCqlxyfe7UFxFdVdOguIrIh/bmbsUJ 7YRE1Guny/zdtouw7H1MG1WaI/tSvBraPP0nQo0e6Z/qV80cBBUypqUY2hBtS1rqU2kg 32r8NJq/oDiwJArif5O+seyntVMPvOxqQIxap7CkScHRnKZoOXtmCRk+YyhxCIHqyw4S ESDOH1YdTyVcfdDZ+LiYo9e0OeugA1/+i+Uyu2UKEpdU1kP35etk1xq33GvPafSoptqk elHg== X-Gm-Message-State: APt69E200SONsFgbQGoUNBi4iwvR6LoAe8ScOgvrTqEZ5yJqrBdkDku9 QVd4PoMQt02SwqPTsxAceze8 X-Received: by 2002:a63:7d1b:: with SMTP id y27-v6mr3642112pgc.418.1529730039341; Fri, 22 Jun 2018 22:00:39 -0700 (PDT) Received: from localhost.localdomain ([2405:204:70c3:aca:6549:5166:32c7:2dab]) by smtp.gmail.com with ESMTPSA id y14-v6sm10787603pgv.37.2018.06.22.22.00.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 22:00:38 -0700 (PDT) From: Manivannan Sadhasivam To: linus.walleij@linaro.org, robh+dt@kernel.org, afaerber@suse.de Cc: 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, thomas.liau@actions-semi.com, jeff.chen@actions-semi.com, Manivannan Sadhasivam Subject: [PATCH v2 2/3] arm64: dts: actions: Add interrupt properties to pinctrl node for S900 Date: Sat, 23 Jun 2018 10:29:53 +0530 Message-Id: <20180623045954.6729-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180623045954.6729-1-manivannan.sadhasivam@linaro.org> References: <20180623045954.6729-1-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add interrupt properties to pinctrl node for Actions Semi S900 SoC. Signed-off-by: Manivannan Sadhasivam --- arch/arm64/boot/dts/actions/s900.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/arch/arm64/boot/dts/actions/s900.dtsi b/arch/arm64/boot/dts/actions/s900.dtsi index aa3a49b0d646..7ae8b931f000 100644 --- a/arch/arm64/boot/dts/actions/s900.dtsi +++ b/arch/arm64/boot/dts/actions/s900.dtsi @@ -181,6 +181,14 @@ gpio-controller; gpio-ranges = <&pinctrl 0 0 146>; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = , + , + , + , + , + ; }; timer: timer@e0228000 { From patchwork Sat Jun 23 04:59:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 139748 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1637678lji; Fri, 22 Jun 2018 22:00:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK4aRECMmKTTWaWyIfjOouV4D2U/GJy/FU+yucdvwXDJNuoBmCDbTRtjSqA8i771R+SOvIg X-Received: by 2002:a17:902:28a6:: with SMTP id f35-v6mr4212956plb.110.1529730054442; Fri, 22 Jun 2018 22:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529730054; cv=none; d=google.com; s=arc-20160816; b=sKoKztpR3XpxjtIl71CgBIGbeiDihb0f8D6N3f/wqW4HrNSKH65S6vo+4c99GpubUD DXe6vJamzU1CGovgGs8U9rM2PZcbfISRgr7Y+28feVIVfSrXEvzceKmrwE/F1clfhf/G eUxULyCeO82abWUoqQygcfDD9j5rxzxKVBi6f3rfnAofCLj50H90wp6UJRTnsfFPHwOY c5W83RfUdmx9E2UOFM5qYmPdMKvDfsODMj7M+9PVBeMMtYKpvSc9xHuEowyd/Juz+yus mgf7eEsqbXFIYwF77TSW/qSL2B2CoGvpRaeWwNjXFHgUJPbenkZvvXia/LjvqXGz0v8v bjhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wFozh2O9hbezI4QuIMCv0LGECSDy2bekeBxfuX06zvY=; b=kl3o73iyXf6otb+1MK6FXctb5671cvyLDAvwouLon8zla1cY7ekNR2NP2PLHVxTfZ/ ai+jTOPfEVvZJc9biwPyXrmA8mvsHmBNOI9OKWy8IezgzBs9l47BkrYPTAfHWSHHPw+m Rq0ucgAmbnBAzaPOvjywF+HoqdzpDWe0ww4ZrKdur9vNuEuIypyixCjhNd//CAZjp6PZ PpEqIGcAtAKSNuA8+3dwZfnsJHI3KOHhBsf2OumzDpNCPzu9BjXT8dv/6OoiqGnztdQW 2Cb8DDaxstgWEi2nTASg6NHysHiRpsCGvtY0COxGtEatJeVN5vd8HTK0xMXDj31/ADrD 3gXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mp205bzs; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32-v6si3487207plf.38.2018.06.22.22.00.54; Fri, 22 Jun 2018 22:00:54 -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=@linaro.org header.s=google header.b=Mp205bzs; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbeFWFAw (ORCPT + 31 others); Sat, 23 Jun 2018 01:00:52 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:47051 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbeFWFAt (ORCPT ); Sat, 23 Jun 2018 01:00:49 -0400 Received: by mail-pf0-f196.google.com with SMTP id q1-v6so4097518pff.13 for ; Fri, 22 Jun 2018 22:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wFozh2O9hbezI4QuIMCv0LGECSDy2bekeBxfuX06zvY=; b=Mp205bzsxGVicxLM1v5ziDJgVw1lYjofkGKHDqnPHBfA+9aA2DPb0b18iK93eLyBJz vPaHiR5+y6z4X4Uwll6WogJZDTo+TjsalskcMwmN8kp98d9jK3Zo/PKckkorQFiujeK3 YSp1JBXCdDajsiPVObEj5XQEw32JJPrqljLqw= 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; bh=wFozh2O9hbezI4QuIMCv0LGECSDy2bekeBxfuX06zvY=; b=ZxhFkr0KUpAJWWUD7BEkOeHSZoVs9/MYc/1+nTvHMh/arN7um4wudvArE4JTwhjGbt WhKWjgL3aWmPN/43YgZ+CI1DH0VGqIdKuYbQH9K4aNiTSu83W1l+HVGeAHIyW/uzV12P bJyXwbGb3a5Fdrt8wcXatbrzLd3M04jCeK+oL3ch+G9mC2TRvmP77444UTanRqUUd9sM Krg93isIECvY1+nOgqmmooA1s4XW+rgTU7m0B6REg/WdAc3iat1qxGE4gWrWH6uJkzAl KG9XiClt6rqkj98Nj9FAv48zEvhYYkoTtO3DdRgLMbU4WW5yLa+u0+astAh+CWU8Tj4C vO9w== X-Gm-Message-State: APt69E0L/6XxRy1MZoBENcxYGS5yWsJfTKWloUBEi5kdS0gnnmMNgpq0 AebyRx26UEmiziHlqK+qMoNM X-Received: by 2002:a63:bd01:: with SMTP id a1-v6mr3651597pgf.319.1529730048569; Fri, 22 Jun 2018 22:00:48 -0700 (PDT) Received: from localhost.localdomain ([2405:204:70c3:aca:6549:5166:32c7:2dab]) by smtp.gmail.com with ESMTPSA id y14-v6sm10787603pgv.37.2018.06.22.22.00.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 22:00:48 -0700 (PDT) From: Manivannan Sadhasivam To: linus.walleij@linaro.org, robh+dt@kernel.org, afaerber@suse.de Cc: 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, thomas.liau@actions-semi.com, jeff.chen@actions-semi.com, Manivannan Sadhasivam Subject: [PATCH v2 3/3] pinctrl: actions: Add interrupt support for OWL S900 SoC Date: Sat, 23 Jun 2018 10:29:54 +0530 Message-Id: <20180623045954.6729-4-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180623045954.6729-1-manivannan.sadhasivam@linaro.org> References: <20180623045954.6729-1-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add interrupt support for Actions Semi OWL S900 SoC. Signed-off-by: Manivannan Sadhasivam --- drivers/pinctrl/actions/Kconfig | 1 + drivers/pinctrl/actions/pinctrl-owl.c | 271 ++++++++++++++++++++++++- drivers/pinctrl/actions/pinctrl-owl.h | 22 +- drivers/pinctrl/actions/pinctrl-s900.c | 31 +-- 4 files changed, 307 insertions(+), 18 deletions(-) -- 2.17.1 Reviewed-by: Andy Shevchenko diff --git a/drivers/pinctrl/actions/Kconfig b/drivers/pinctrl/actions/Kconfig index 490927b4ea76..2397cb0f6011 100644 --- a/drivers/pinctrl/actions/Kconfig +++ b/drivers/pinctrl/actions/Kconfig @@ -5,6 +5,7 @@ config PINCTRL_OWL select PINCONF select GENERIC_PINCONF select GPIOLIB + select GPIOLIB_IRQCHIP help Say Y here to enable Actions Semi OWL pinctrl driver diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c index 76243caa08c6..ce032d71dad5 100644 --- a/drivers/pinctrl/actions/pinctrl-owl.c +++ b/drivers/pinctrl/actions/pinctrl-owl.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,9 @@ struct owl_pinctrl { struct clk *clk; const struct owl_pinctrl_soc_data *soc; void __iomem *base; + struct irq_chip irq_chip; + unsigned int num_irq; + unsigned int *irq; }; static void owl_update_bits(void __iomem *base, u32 mask, u32 val) @@ -701,10 +705,213 @@ static int owl_gpio_direction_output(struct gpio_chip *chip, return 0; } +static void irq_set_type(struct owl_pinctrl *pctrl, int gpio, unsigned int type) +{ + const struct owl_gpio_port *port; + void __iomem *gpio_base; + unsigned long flags; + unsigned int offset, value, irq_type = 0; + + switch (type) { + case IRQ_TYPE_EDGE_BOTH: + /* + * Since the hardware doesn't support interrupts on both edges, + * emulate it in the software by setting the single edge + * interrupt and switching to the opposite edge while ACKing + * the interrupt + */ + if (owl_gpio_get(&pctrl->chip, gpio)) + irq_type = OWL_GPIO_INT_EDGE_FALLING; + else + irq_type = OWL_GPIO_INT_EDGE_RISING; + break; + + case IRQ_TYPE_EDGE_RISING: + irq_type = OWL_GPIO_INT_EDGE_RISING; + break; + + case IRQ_TYPE_EDGE_FALLING: + irq_type = OWL_GPIO_INT_EDGE_FALLING; + break; + + case IRQ_TYPE_LEVEL_HIGH: + irq_type = OWL_GPIO_INT_LEVEL_HIGH; + break; + + case IRQ_TYPE_LEVEL_LOW: + irq_type = OWL_GPIO_INT_LEVEL_LOW; + break; + + default: + break; + } + + port = owl_gpio_get_port(pctrl, &gpio); + if (WARN_ON(port == NULL)) + return; + + gpio_base = pctrl->base + port->offset; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + offset = (gpio < 16) ? 4 : 0; + value = readl_relaxed(gpio_base + port->intc_type + offset); + value &= ~(OWL_GPIO_INT_MASK << ((gpio % 16) * 2)); + value |= irq_type << ((gpio % 16) * 2); + writel_relaxed(value, gpio_base + port->intc_type + offset); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); +} + +static void owl_gpio_irq_mask(struct irq_data *data) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); + const struct owl_gpio_port *port; + void __iomem *gpio_base; + unsigned long flags; + unsigned int gpio = data->hwirq; + u32 val; + + port = owl_gpio_get_port(pctrl, &gpio); + if (WARN_ON(port == NULL)) + return; + + gpio_base = pctrl->base + port->offset; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + owl_gpio_update_reg(gpio_base + port->intc_msk, gpio, false); + + /* disable port interrupt if no interrupt pending bit is active */ + val = readl_relaxed(gpio_base + port->intc_msk); + if (val == 0) + owl_gpio_update_reg(gpio_base + port->intc_ctl, + OWL_GPIO_CTLR_ENABLE, false); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); +} + +static void owl_gpio_irq_unmask(struct irq_data *data) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); + const struct owl_gpio_port *port; + void __iomem *gpio_base; + unsigned long flags; + unsigned int gpio = data->hwirq; + u32 value; + + port = owl_gpio_get_port(pctrl, &gpio); + if (WARN_ON(port == NULL)) + return; + + gpio_base = pctrl->base + port->offset; + raw_spin_lock_irqsave(&pctrl->lock, flags); + + /* enable port interrupt */ + value = readl_relaxed(gpio_base + port->intc_ctl); + value |= BIT(OWL_GPIO_CTLR_ENABLE) | BIT(OWL_GPIO_CTLR_SAMPLE_CLK_24M); + writel_relaxed(value, gpio_base + port->intc_ctl); + + /* enable GPIO interrupt */ + owl_gpio_update_reg(gpio_base + port->intc_msk, gpio, true); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); +} + +static void owl_gpio_irq_ack(struct irq_data *data) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); + const struct owl_gpio_port *port; + void __iomem *gpio_base; + unsigned long flags; + unsigned int gpio = data->hwirq; + + /* + * Switch the interrupt edge to the opposite edge of the interrupt + * which got triggered for the case of emulating both edges + */ + if (irqd_get_trigger_type(data) == IRQ_TYPE_EDGE_BOTH) { + if (owl_gpio_get(gc, gpio)) + irq_set_type(pctrl, gpio, IRQ_TYPE_EDGE_FALLING); + else + irq_set_type(pctrl, gpio, IRQ_TYPE_EDGE_RISING); + } + + port = owl_gpio_get_port(pctrl, &gpio); + if (WARN_ON(port == NULL)) + return; + + gpio_base = pctrl->base + port->offset; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + owl_gpio_update_reg(gpio_base + port->intc_ctl, + OWL_GPIO_CTLR_PENDING, true); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); +} + +static int owl_gpio_irq_set_type(struct irq_data *data, unsigned int type) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(data); + struct owl_pinctrl *pctrl = gpiochip_get_data(gc); + + if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) + irq_set_handler_locked(data, handle_level_irq); + else + irq_set_handler_locked(data, handle_edge_irq); + + irq_set_type(pctrl, data->hwirq, type); + + return 0; +} + +static void owl_gpio_irq_handler(struct irq_desc *desc) +{ + struct owl_pinctrl *pctrl = irq_desc_get_handler_data(desc); + struct irq_chip *chip = irq_desc_get_chip(desc); + struct irq_domain *domain = pctrl->chip.irq.domain; + unsigned int parent = irq_desc_get_irq(desc); + const struct owl_gpio_port *port; + void __iomem *base; + unsigned int pin, irq, offset = 0, i; + unsigned long pending_irq; + + chained_irq_enter(chip, desc); + + for (i = 0; i < pctrl->soc->nports; i++) { + port = &pctrl->soc->ports[i]; + base = pctrl->base + port->offset; + + /* skip ports that are not associated with this irq */ + if (parent != pctrl->irq[i]) + goto skip; + + pending_irq = readl_relaxed(base + port->intc_pd); + + for_each_set_bit(pin, &pending_irq, port->pins) { + irq = irq_find_mapping(domain, offset + pin); + generic_handle_irq(irq); + + /* clear pending interrupt */ + owl_gpio_update_reg(base + port->intc_pd, pin, true); + } + +skip: + offset += port->pins; + } + + chained_irq_exit(chip, desc); +} + static int owl_gpio_init(struct owl_pinctrl *pctrl) { struct gpio_chip *chip; - int ret; + struct gpio_irq_chip *gpio_irq; + int ret, i, j, offset; chip = &pctrl->chip; chip->base = -1; @@ -714,6 +921,35 @@ static int owl_gpio_init(struct owl_pinctrl *pctrl) chip->owner = THIS_MODULE; chip->of_node = pctrl->dev->of_node; + pctrl->irq_chip.name = chip->of_node->name; + pctrl->irq_chip.irq_ack = owl_gpio_irq_ack; + pctrl->irq_chip.irq_mask = owl_gpio_irq_mask; + pctrl->irq_chip.irq_unmask = owl_gpio_irq_unmask; + pctrl->irq_chip.irq_set_type = owl_gpio_irq_set_type; + + gpio_irq = &chip->irq; + gpio_irq->chip = &pctrl->irq_chip; + gpio_irq->handler = handle_simple_irq; + gpio_irq->default_type = IRQ_TYPE_NONE; + gpio_irq->parent_handler = owl_gpio_irq_handler; + gpio_irq->parent_handler_data = pctrl; + gpio_irq->num_parents = pctrl->num_irq; + gpio_irq->parents = pctrl->irq; + + gpio_irq->map = devm_kcalloc(pctrl->dev, chip->ngpio, + sizeof(*gpio_irq->map), GFP_KERNEL); + if (!gpio_irq->map) + return -ENOMEM; + + for (i = 0, offset = 0; i < pctrl->soc->nports; i++) { + const struct owl_gpio_port *port = &pctrl->soc->ports[i]; + + for (j = 0; j < port->pins; j++) + gpio_irq->map[offset + j] = gpio_irq->parents[i]; + + offset += port->pins; + } + ret = gpiochip_add_data(&pctrl->chip, pctrl); if (ret) { dev_err(pctrl->dev, "failed to register gpiochip\n"); @@ -728,7 +964,7 @@ int owl_pinctrl_probe(struct platform_device *pdev, { struct resource *res; struct owl_pinctrl *pctrl; - int ret; + int ret, i; pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); if (!pctrl) @@ -772,14 +1008,41 @@ int owl_pinctrl_probe(struct platform_device *pdev, &owl_pinctrl_desc, pctrl); if (IS_ERR(pctrl->pctrldev)) { dev_err(&pdev->dev, "could not register Actions OWL pinmux driver\n"); - return PTR_ERR(pctrl->pctrldev); + ret = PTR_ERR(pctrl->pctrldev); + goto err_exit; + } + + ret = platform_irq_count(pdev); + if (ret < 0) + goto err_exit; + + pctrl->num_irq = ret; + + pctrl->irq = devm_kcalloc(&pdev->dev, pctrl->num_irq, + sizeof(*pctrl->irq), GFP_KERNEL); + if (!pctrl->irq) { + ret = -ENOMEM; + goto err_exit; + } + + for (i = 0; i < pctrl->num_irq ; i++) { + pctrl->irq[i] = platform_get_irq(pdev, i); + if (pctrl->irq[i] < 0) { + ret = pctrl->irq[i]; + goto err_exit; + } } ret = owl_gpio_init(pctrl); if (ret) - return ret; + goto err_exit; platform_set_drvdata(pdev, pctrl); return 0; + +err_exit: + clk_disable_unprepare(pctrl->clk); + + return ret; } diff --git a/drivers/pinctrl/actions/pinctrl-owl.h b/drivers/pinctrl/actions/pinctrl-owl.h index 74342378937c..a724d1d406d4 100644 --- a/drivers/pinctrl/actions/pinctrl-owl.h +++ b/drivers/pinctrl/actions/pinctrl-owl.h @@ -29,6 +29,18 @@ enum owl_pinconf_drv { OWL_PINCONF_DRV_12MA, }; +/* GPIO CTRL Bit Definition */ +#define OWL_GPIO_CTLR_PENDING 0 +#define OWL_GPIO_CTLR_ENABLE 1 +#define OWL_GPIO_CTLR_SAMPLE_CLK_24M 2 + +/* GPIO TYPE Bit Definition */ +#define OWL_GPIO_INT_LEVEL_HIGH 0 +#define OWL_GPIO_INT_LEVEL_LOW 1 +#define OWL_GPIO_INT_EDGE_RISING 2 +#define OWL_GPIO_INT_EDGE_FALLING 3 +#define OWL_GPIO_INT_MASK 3 + /** * struct owl_pullctl - Actions pad pull control register * @reg: offset to the pull control register @@ -121,6 +133,10 @@ struct owl_pinmux_func { * @outen: offset of the output enable register. * @inen: offset of the input enable register. * @dat: offset of the data register. + * @intc_ctl: offset of the interrupt control register. + * @intc_pd: offset of the interrupt pending register. + * @intc_msk: offset of the interrupt mask register. + * @intc_type: offset of the interrupt type register. */ struct owl_gpio_port { unsigned int offset; @@ -128,6 +144,10 @@ struct owl_gpio_port { unsigned int outen; unsigned int inen; unsigned int dat; + unsigned int intc_ctl; + unsigned int intc_pd; + unsigned int intc_msk; + unsigned int intc_type; }; /** @@ -140,7 +160,7 @@ struct owl_gpio_port { * @ngroups: number of entries in @groups. * @padinfo: array describing the pad info of this SoC. * @ngpios: number of pingroups the driver should expose as GPIOs. - * @port: array describing all GPIO ports of this SoC. + * @ports: array describing all GPIO ports of this SoC. * @nports: number of GPIO ports in this SoC. */ struct owl_pinctrl_soc_data { diff --git a/drivers/pinctrl/actions/pinctrl-s900.c b/drivers/pinctrl/actions/pinctrl-s900.c index 5503c7945764..ea67b14ef93b 100644 --- a/drivers/pinctrl/actions/pinctrl-s900.c +++ b/drivers/pinctrl/actions/pinctrl-s900.c @@ -1821,22 +1821,27 @@ static struct owl_padinfo s900_padinfo[NUM_PADS] = { [SGPIO3] = PAD_INFO_PULLCTL_ST(SGPIO3) }; -#define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat) \ - [OWL_GPIO_PORT_##port] = { \ - .offset = base, \ - .pins = count, \ - .outen = _outen, \ - .inen = _inen, \ - .dat = _dat, \ +#define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat, \ + _intc_ctl, _intc_pd, _intc_msk, _intc_type) \ + [OWL_GPIO_PORT_##port] = { \ + .offset = base, \ + .pins = count, \ + .outen = _outen, \ + .inen = _inen, \ + .dat = _dat, \ + .intc_ctl = _intc_ctl, \ + .intc_pd = _intc_pd, \ + .intc_msk = _intc_msk, \ + .intc_type = _intc_type, \ } static const struct owl_gpio_port s900_gpio_ports[] = { - OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8), - OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8), - OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8), - OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8), - OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8), - OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8) + OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8, 0x204, 0x208, 0x20C, 0x240), + OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8, 0x534, 0x204, 0x208, 0x23C), + OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8, 0x52C, 0x200, 0x204, 0x238), + OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8, 0x524, 0x1FC, 0x200, 0x234), + OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8, 0x51C, 0x1F8, 0x1FC, 0x230), + OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8, 0x460, 0x140, 0x144, 0x178) }; static struct owl_pinctrl_soc_data s900_pinctrl_data = {