From patchwork Fri Nov 2 14:56:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGFsIFZva8OhxI0=?= X-Patchwork-Id: 10665597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88B6A15E9 for ; Fri, 2 Nov 2018 14:56:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A52D286D3 for ; Fri, 2 Nov 2018 14:56:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D8C928609; Fri, 2 Nov 2018 14:56:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0819628609 for ; Fri, 2 Nov 2018 14:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbeKCAEC (ORCPT ); Fri, 2 Nov 2018 20:04:02 -0400 Received: from mail-eopbgr60052.outbound.protection.outlook.com ([40.107.6.52]:28981 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726849AbeKCAEC (ORCPT ); Fri, 2 Nov 2018 20:04:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ysoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rld2iaq1NWEpCFF+aedRSI+221uiWVKuw7W+gycP0cw=; b=XbMqX20lTJ4h/sW9uvmPF5oRTRmz5ntWjUkSfz5v4pHYQBQVRMJd6ODPOTHqYEP31ZUWGoXNh2L5uK/86cp9kPh6CkyrqfkyNzbYM0YeLysDgL6RGW0eFNnYtZ6c4UmOsISyHaXO8nyeYP1tj1bxCAww6JjKclZQzvd6/QvOrqo= Received: from DB7PR04MB4667.eurprd04.prod.outlook.com (52.135.139.13) by DB7PR04MB4987.eurprd04.prod.outlook.com (20.176.234.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Fri, 2 Nov 2018 14:56:35 +0000 Received: from DB7PR04MB4667.eurprd04.prod.outlook.com ([fe80::2849:23b4:7b26:a421]) by DB7PR04MB4667.eurprd04.prod.outlook.com ([fe80::2849:23b4:7b26:a421%3]) with mapi id 15.20.1294.024; Fri, 2 Nov 2018 14:56:35 +0000 From: =?utf-8?b?Vm9rw6HEjSBNaWNoYWw=?= To: Rob Herring , Bartlomiej Zolnierkiewicz CC: "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Jyri Sarha , =?utf-8?b?Vm9rw6HEjSBNaWNoYWw=?= Subject: [PATCH fbdev-for-next 2/2] video: ssd1307fb: Add support for the reset-active-low property Thread-Topic: [PATCH fbdev-for-next 2/2] video: ssd1307fb: Add support for the reset-active-low property Thread-Index: AQHUcrw/3qwIrYVC/Uy4SnGDDmELbw== Date: Fri, 2 Nov 2018 14:56:35 +0000 Message-ID: <1541170556-75032-2-git-send-email-michal.vokac@ysoft.com> References: <1541170556-75032-1-git-send-email-michal.vokac@ysoft.com> In-Reply-To: <1541170556-75032-1-git-send-email-michal.vokac@ysoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P194CA0086.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::27) To DB7PR04MB4667.eurprd04.prod.outlook.com (2603:10a6:5:37::13) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michal.Vokac@ysoft.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [89.24.100.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB7PR04MB4987;6:sTQQ+vY576DDcYEIuNDceNHyFgem2YPV49r2J9anE/FoH3bC5W5kwunbtGEocK4z1fn1lhqgzhApJwtNpttSmz9Hwext/8MlLPs+4pU9FNWjgHHhGVLgDpzr7bOHhZ7+ih4e+SQUQ1TBZEFpOrzXoQNwOr9k3X4LDYWgU0uM5CLqcIeMBHVc6kRF24lKsKmFLlXJJR7RkCnB8Zh4vS3nTj/JZXeoTuyss/jLjvwJkqh8gsw/ADCf6Rs39mRYemafhJu4dYfFsS8EA2FCO5demG6I2mbK1tswYv9Cqax1qu8CUyY1+ipJZCx6GjnT3b7Rxeg5yH1Mjs81tA5E2fK6+4hDX/raJsy57kz9UE90V8qtRj7CkmLtZ9FUxkN4NsH3EaZGpW5M+PL1aWE+Zh8jOsDqZhAvWmKEsFvuIcm96PUhnKZghjFaQ+1StVVBRWVpEZ6EF0gnrFYSBK3cR4f5LA==;5:9FMaPu/DiaKqe6zucfRpGdKbw9IIqKnfIf7hYNbdxO2/qN+JnHI0wfLEv07+ffVpIxmX6dgDBSluq92bi7R+p1Ey6qkry2kXNJ9hP5Lx8j8SXK/IlIbFK87/+07Wuqn0GcYkcj3VNNCUTEndv1ZqpWDFYiL5KXAhvvtVyg6ORBg=;7:6arS4jMVUDfQh5TFSqiU3T7osdvKa8fyFUGGot+GtlULo7+bBAu9hN99Mhl0Box0DeKr1EnaQIXREfcdhzdLoEeN1yzlbz6yYuNyCrZsIZaAOhdjxLgTl8JEevDU4EdXbNS2jbNQ9g1mumZLYFsdqg== x-ms-office365-filtering-correlation-id: 983bd67c-6719-48bd-39b7-08d640d36242 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4987; x-ms-traffictypediagnostic: DB7PR04MB4987: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231382)(944501410)(52105095)(3002001)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:DB7PR04MB4987;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4987; x-forefront-prvs: 08444C7C87 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39850400004)(366004)(376002)(346002)(396003)(189003)(199004)(6512007)(52116002)(54906003)(110136005)(386003)(53936002)(6116002)(2906002)(3846002)(6506007)(476003)(486006)(76176011)(2900100001)(186003)(8676002)(86362001)(26005)(6436002)(316002)(102836004)(66066001)(99286004)(85182001)(81166006)(81156014)(7736002)(8936002)(305945005)(25786009)(68736007)(36756003)(14454004)(5660300001)(107886003)(6486002)(97736004)(478600001)(446003)(71200400001)(4326008)(11346002)(2616005)(106356001)(105586002)(14444005)(72206003)(256004)(71190400001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4987;H:DB7PR04MB4667.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: ysoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1UEPURNBqevTvr8sOM8TXyKyT8tEu/xVDJZW6i3DZ4cYdCJqGS2rzbBM7FFlSphTDAnnRSi8+njhg3xX9Q4gYYGHjGk+WYZHjp8THTTFqDbE6VoFFJlaa2AZ9CBp8B+d/Yz/240KPbwCd9zEvum7GLk+rH+xWDqUsvEfdSVE+qF3evdpoWEJhvQDR4V+0MdaJLbKnGO7hNOTlkEMOMOlZwV4lj25f4PVJaf7NqkJwd8dIdask6kGcxeRTxDvHz0jCpAdjc9rwr2NKAeWV2TLiow2oWkA1pKp7Zv/ue/vm+oiFLxFYSJUTRG/cJPT6HlTFA60g/83h7jK+Luask2Kg8KInxj8kg0MieVaWwkpD98= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <6FF874686236FD4DB68E4A9A103ABD13@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: ysoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 983bd67c-6719-48bd-39b7-08d640d36242 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2018 14:56:35.2029 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b5839965-430f-4be2-b282-d7a3149f2b37 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4987 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SSD130x OLED display reset signal is active low. Now the reset sequence is implemented in such a way that DTS authors are forced to define the reset-gpios property with GPIO_ACTIVE_HIGH to make the reset work. Add the reset-active-low property so the signal is inverted once again and the GPIO_ACTIVE_LOW work as expected. Signed-off-by: Michal Vokáč --- drivers/video/fbdev/ssd1307fb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index e7ae135..790f1c4 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -608,6 +608,7 @@ static int ssd1307fb_probe(struct i2c_client *client, struct fb_deferred_io *ssd1307fb_defio; u32 vmem_size; struct ssd1307fb_par *par; + bool reset_active_low; u8 *vmem; int ret; @@ -671,6 +672,7 @@ static int ssd1307fb_probe(struct i2c_client *client, par->com_seq = of_property_read_bool(node, "solomon,com-seq"); par->com_lrremap = of_property_read_bool(node, "solomon,com-lrremap"); par->com_invdir = of_property_read_bool(node, "solomon,com-invdir"); + reset_active_low = of_property_read_bool(node, "reset-active-low"); par->contrast = 127; par->vcomh = par->device_info->default_vcomh; @@ -728,9 +730,9 @@ static int ssd1307fb_probe(struct i2c_client *client, if (par->reset) { /* Reset the screen */ - gpiod_set_value_cansleep(par->reset, 0); + gpiod_set_value_cansleep(par->reset, reset_active_low); udelay(4); - gpiod_set_value_cansleep(par->reset, 1); + gpiod_set_value_cansleep(par->reset, !reset_active_low); udelay(4); }