Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp52522imu; Wed, 19 Dec 2018 13:29:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYjp9egBRQUPEuNE6rxIA1Blc9tjlBrnUZo2y7AU7xamjzJ5FnMOByU7+ipmW4HJL9de2t X-Received: by 2002:a63:4342:: with SMTP id q63mr20791087pga.63.1545254980970; Wed, 19 Dec 2018 13:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545254980; cv=none; d=google.com; s=arc-20160816; b=hx7msAPN1/1s2QnYqhYyPUfiBM86KBzRuS7SwPLqmcJrEIsWytE+9Vn0N9AD/rsKdl JrX8fkJBp/9aXwYfskM/4icbdEzSN9rtM8Srbm5Ss0SLKCr23/2z98/Qr93yQkR0VJAm se266Y5IkWaEyFqJAzcCZgiFTE1eJsRdAtbjPXfhCc5ESFJkXO1eE1Km4tr/oktdzzQi ryv2bvt2rYyCnOHFq5HrlHYVPr3MiGcfyaJy90AQKqYiaO/z49czb2XUaVYS8ENGGif1 8xrTs6Ojb4ciJRuMq9ujv+Hgx/2VNnEQFoVLZvdJmOiNZWfpvtHluHT29m+P0bI9T4zk LOaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=T0DVSq/1hvO/ebMwFX3HnvvUWzoOCaU5z2Zk7sXIwOM=; b=uXZjCI8kZaA/qpDgtUBS3dR8J+sr1BF4ef08Si1ElQ0lI03RKScVErMmEU83PNVPIG JVYihOvviv9hYF4uiRD/OLydi4rvzJGX3HWS0oIXZR3UhK0VABxK0bXns0ZFnnISqP1C T9wjgSx7AoesoRJ80+f5eBsmAiLBYu6Aj+b4WjHvaYRfstckvWGhqtlMenf46tGdcbJ1 H36/8STrnWsE4F9jby7vhSSd8LOQ9IjlbaF38I1TT94O4jlrhvzS1aBPVNtWUtOQJY1R viVyefcCOTSXWbq648jc0J3VO88sUM6fbYQi0FA/meqL3Ing3xC5OsRqwjVpyeyzuiFh 0OuA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si16866608pgk.103.2018.12.19.13.29.25; Wed, 19 Dec 2018 13:29:40 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730496AbeLSR3y (ORCPT + 99 others); Wed, 19 Dec 2018 12:29:54 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:38185 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728448AbeLSR3w (ORCPT ); Wed, 19 Dec 2018 12:29:52 -0500 Received: by mail-oi1-f193.google.com with SMTP id a77so2254494oii.5; Wed, 19 Dec 2018 09:29:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=T0DVSq/1hvO/ebMwFX3HnvvUWzoOCaU5z2Zk7sXIwOM=; b=mUwIK/Lf+JgumRu6sLBHhyo3aQmxs2P8YcYUXj/UsX018E+cuE2OMhKbDeLPKGr6Y6 8GF2e1UNb6nyEK5XRy96CeFZO8RxKVbDXck9rFQW+OcUspp15apYUez1iiCcgefuDtED 8fqUxv+yVWgwO81dg8v8g6d4b88y/UnY4aP+0MSYaBB6NeTLkdf0HKzJNDqos7WpfgX+ 4RdvKCDpXxK5cYinacQ+qySwtxH3lu5G3PuaJLIdEQD9nacHR5o6/VlU0g78OHaMLFgy 7vkTkU1Rr+Mvmj0QszniF2l3ae+udw0/pOoydKKGjmTk86h7LMhWvTg90ywzKmghJKTn zhbw== X-Gm-Message-State: AA+aEWbwStarMM3qyL5GYNsv00lA8QfjfE5Cs899b9UtSlRUch8YBUjr kAsvTiuImJdUXzjZwhkJnw== X-Received: by 2002:aca:58d7:: with SMTP id m206mr1703563oib.140.1545240590805; Wed, 19 Dec 2018 09:29:50 -0800 (PST) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id 30sm9325529ots.52.2018.12.19.09.29.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Dec 2018 09:29:50 -0800 (PST) Date: Wed, 19 Dec 2018 11:29:49 -0600 From: Rob Herring To: =?utf-8?B?Vm9rw6HEjQ==?= Michal Cc: Bartlomiej Zolnierkiewicz , Shawn Guo , Fabio Estevam , Alexandre Belloni , Maxime Ripard , "linux-fbdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH 4/4] ARM: mxs: =?iso-8859-1?Q?c?= =?iso-8859-1?Q?fa10036=3A_Fixup_OLED=A0display?= reset polarity Message-ID: <20181219172949.GA7680@bogus> References: <1543935806-94880-1-git-send-email-michal.vokac@ysoft.com> <1543935806-94880-5-git-send-email-michal.vokac@ysoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1543935806-94880-5-git-send-email-michal.vokac@ysoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 04, 2018 at 03:03:40PM +0000, Vokáč Michal wrote: > There was a bug in reset signal generation in ssd1307fb OLED driver. > The display needs an active-low reset signal but the driver produced > the correct sequence only if the GPIO used for reset was specified as > GPIO_ACTIVE_HIGH. > > Now as the OLED driver is fixed it is also necessarry to implement > a fixup for all current users of the old DT ABI. There is only one > in-tree user and that is the Crystalfontz CFA-10036 board. In case > this board is booting and GPIO_ACTIVE_HIGH is used for reset we > override it to GPIO_ACTIVE_LOW. > > Signed-off-by: Michal Vokáč > --- > arch/arm/mach-mxs/mach-mxs.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > > diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c > index 1c6062d..23c260c 100644 > --- a/arch/arm/mach-mxs/mach-mxs.c > +++ b/arch/arm/mach-mxs/mach-mxs.c > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -268,9 +269,53 @@ static void __init apx4devkit_init(void) > apx4devkit_phy_fixup); > } > > +#define OLED_RESET_GPIO_LEN 3 > +#define OLED_RESET_GPIO_SIZE (OLED_RESET_GPIO_LEN * sizeof(u32)) > + > +static void __init crystalfontz_oled_reset_fixup(void) > +{ > + struct property *newgpio; > + struct device_node *np; > + u32 *gpiospec; > + int i, ret; > + > + np = of_find_compatible_node(NULL, NULL, "solomon,ssd1306fb-i2c"); > + if (!np) > + return; > + > + newgpio = kzalloc(sizeof(*newgpio) + OLED_RESET_GPIO_SIZE, GFP_KERNEL); > + if (!newgpio) > + return; > + > + newgpio->value = newgpio + 1; > + newgpio->length = OLED_RESET_GPIO_SIZE; > + newgpio->name = kstrdup("reset-gpios", GFP_KERNEL); > + if (!newgpio->name) { > + kfree(newgpio); > + return; > + } > + > + gpiospec = newgpio->value; > + for (i = 0; i < OLED_RESET_GPIO_LEN; i++) { > + ret = of_property_read_u32_index(np, "reset-gpios", i, > + &gpiospec[i]); Don't we have a helper to read the whole array? Otherwise, for the series: Reviewed-by: Rob Herring > + if (ret) { > + kfree(newgpio); > + return; > + } > + } > + > + if (!(gpiospec[2] & OF_GPIO_ACTIVE_LOW)) { > + gpiospec[2] |= OF_GPIO_ACTIVE_LOW; > + cpu_to_be32_array(gpiospec, gpiospec, OLED_RESET_GPIO_LEN); > + of_update_property(np, newgpio); > + } > +} > + > static void __init crystalfontz_init(void) > { > update_fec_mac_prop(OUI_CRYSTALFONTZ); > + crystalfontz_oled_reset_fixup(); > } > > static void __init duckbill_init(void) > -- > 2.1.4 >