From patchwork Fri Apr 7 12:38:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 748220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vzzcy2sjCz9s7s for ; Fri, 7 Apr 2017 22:37:54 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933452AbdDGMhx (ORCPT ); Fri, 7 Apr 2017 08:37:53 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:47526 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755203AbdDGMhs (ORCPT ); Fri, 7 Apr 2017 08:37:48 -0400 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v37CZv5X015176; Fri, 7 Apr 2017 07:37:41 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Received: from mail2.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0a-001ae601.pphosted.com with ESMTP id 29p3qk8q12-1; Fri, 07 Apr 2017 07:37:41 -0500 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail2.cirrus.com (Postfix) with ESMTP id 423EA6121ADF; Fri, 7 Apr 2017 07:37:41 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.301.0; Fri, 7 Apr 2017 13:37:40 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.223.36]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id v37CaxdS024920; Fri, 7 Apr 2017 13:36:59 +0100 From: Charles Keepax To: , CC: , , , , , , Subject: [PATCH 1/2] mfd: arizona: Add GPIO maintain state flag Date: Fri, 7 Apr 2017 13:38:44 +0100 Message-ID: <1491568725-14882-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704070106 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The Arizona devices only maintain the state of output GPIOs whilst the CODEC is active, this can cause issues if the CODEC suspends whilst something is relying on the state of one of its GPIOs. However, in many systems the CODEC GPIOs are used for audio related features and thus the state of the GPIOs is unimportant whilst the CODEC is suspended. Often keeping the CODEC resumed in such a system would incur a power impact that is unacceptable. Add a flag through the second cell of the GPIO specifier in device tree, to allow the user to select whether a GPIO being configured as an output should keep the CODEC resumed. Signed-off-by: Charles Keepax --- Documentation/devicetree/bindings/mfd/arizona.txt | 5 ++++- include/dt-bindings/mfd/arizona.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt index 8f2e282..6af0d82 100644 --- a/Documentation/devicetree/bindings/mfd/arizona.txt +++ b/Documentation/devicetree/bindings/mfd/arizona.txt @@ -30,7 +30,10 @@ Required properties: - gpio-controller : Indicates this device is a GPIO controller. - #gpio-cells : Must be 2. The first cell is the pin number and the - second cell is used to specify optional parameters (currently unused). + second cell is used to specify optional parameters, the following flags + are supported: + "ARIZONA_GP_MAINTAIN" the output of the GPIO must be maintained, this + prevents the CODEC going into low power mode. - AVDD-supply, DBVDD1-supply, CPVDD-supply : Power supplies for the device, as covered in Documentation/devicetree/bindings/regulator/regulator.txt diff --git a/include/dt-bindings/mfd/arizona.h b/include/dt-bindings/mfd/arizona.h index dedf46f..68f3782 100644 --- a/include/dt-bindings/mfd/arizona.h +++ b/include/dt-bindings/mfd/arizona.h @@ -77,6 +77,9 @@ #define ARIZONA_GP_INPUT (ARIZONA_GP_FN_GPIO | \ ARIZONA_GPN_DIR) +/* Flags for the GPIO driver properties */ +#define ARIZONA_GP_MAINTAIN 0x80000000 + #define ARIZONA_32KZ_MCLK1 1 #define ARIZONA_32KZ_MCLK2 2 #define ARIZONA_32KZ_NONE 3