Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30967073rwd; Thu, 6 Jul 2023 13:29:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFOXjgLXSiG/7pgbvodNmMOFY+aSGPYppao9xpVEGRsheC8jZyu04czePGGc6XjUsliCxjO X-Received: by 2002:a17:902:d2cd:b0:1b5:49fc:e336 with SMTP id n13-20020a170902d2cd00b001b549fce336mr2896081plc.42.1688675399367; Thu, 06 Jul 2023 13:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688675399; cv=none; d=google.com; s=arc-20160816; b=KsMz9GgaAv3CIql//r2/+Z45XBo/jq13Q0z2BPtdHZC0Sfmg+aGQCoCfS5i5eA0LeX XCsC6Uk4VXTK7FnXmPNjrk9IJuDXd09REYp7MuJFMXMG/B9N1JlQuaDLms9mO1SSdh2D u5awLBSz/i16OPTz76cUsO4Xo2KPvkAU9KWymcsSJ8r0QDdg+KGaJ2qGU538OkjDQE87 mE9Pr97HL9FknuQFijRXn1Bdq1TIrH6f4kaPCYmNggkPq5VwTw/ZJuA1EpGp7O+fd6UP EaudX2pncTvnQY84PqMeSLqb2oZSkyINfwB9Wbl5vMyMRALIk3Or9CZCFMFIDMdzzDkf jctw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=E2gzTkf0PtkXeEQW8FKB5ymf4Nj8iv6XCGSy6pM3Cug=; fh=/GMZDZQh9p4nsm5JnscjUP+9fAKVood/uTHGVeEAE5Y=; b=xARhyV41VPpDN6UGWoK5Hv6UfL+oYRDEbaRqwux2QJDYP/2rmxHPoGPdCFMgRUXyv8 +L3PeZlUsOgy88D9LUFhh7b+TnXbOTzuxwsm/dhWPawTCexRKh1fyQ8rhZ4/3qZHQzvW IKOXDx8zGqOubnxGvRHACCzZL9YJQmwFeYghXJ92Tp9ZMJSSXqhMpgAaGqXHFTK4Gtbg JuZXzVrkzBB/0pTISVmN9+qJOYbkLSEfDhr86/cxu1bakrhaJaiXmzZarhNSg3DcLYdn ZsYo8nyypIOezpHpYtUcEhyRtdqpiwSlE2InvwaOaA808CemgMeUqdWYbX9EyepR0zR+ G/0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=E3ycVKWA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bi5-20020a170902bf0500b001b88e99659fsi1817999plb.202.2023.07.06.13.29.45; Thu, 06 Jul 2023 13:29:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=E3ycVKWA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232373AbjGFTtq (ORCPT + 99 others); Thu, 6 Jul 2023 15:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbjGFTto (ORCPT ); Thu, 6 Jul 2023 15:49:44 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3F4C1BEE for ; Thu, 6 Jul 2023 12:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:Content-Type:Mime-Version: References:In-Reply-To:Message-Id:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=E2gzTkf0PtkXeEQW8FKB5ymf4Nj8iv6XCGSy6pM3Cug=; b=E3ycVKWA+dZ0D9c8Dsum8/ZKcC 68dcNObmqGRU9lNcD5uU4oMcvNEDJl/Ij7/0V0ZZsCAjVh+ssNhSIUf47wWL5IZmtpI7CdOokMTxi hfm4WlVKzNjxVivL6ycN0lwk70QL56IgBikYwZYjQzDBj0/RhhwAIuLdWTI5fC0cdYzU=; Received: from modemcable061.19-161-184.mc.videotron.ca ([184.161.19.61]:46308 helo=pettiford) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qHUyw-0003Gs-21; Thu, 06 Jul 2023 15:49:38 -0400 Date: Thu, 6 Jul 2023 15:49:37 -0400 From: Hugo Villeneuve To: Miguel Ojeda Cc: Miguel Ojeda , Hugo Villeneuve , linux-kernel@vger.kernel.org, Lars Poeschel , geert@linux-m68k.org Message-Id: <20230706154937.1380bdcf9d84e1cff78911fa@hugovil.com> In-Reply-To: References: <20230706185100.84322-1-hugo@hugovil.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 184.161.19.61 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH] auxdisplay: hd44780: move cursor home after clear display command X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Jul 2023 21:33:05 +0200 Miguel Ojeda wrote: > On Thu, Jul 6, 2023 at 8:51 PM Hugo Villeneuve wrote: > > > > The "clear display" command on the NewHaven NHD-0220DZW-AG5 display > > does NOT change the DDRAM address to 00h (home position) like the > > standard Hitachi HD44780 controller. As a consequence, the starting > > position of the initial string LCD_INIT_TEXT is not guaranteed to be > > at 0,0 depending on where the cursor was before the clear display > > command. > > > > Extract of CLEAR_DISPLAY command from datasheets of: > > > > Hitachi HD44780: > > ... It then sets DDRAM address 0 into the address counter... > > > > NewHaven NHD-0220DZW-AG5 datasheet: > > ... This instruction does not change the DDRAM Address > > > > Move the cursor home after sending clear display command to support > > non-standard LCDs. > > > > Signed-off-by: Hugo Villeneuve > > Thanks! Sounds good to me, as long the extra command does not > introduce some issue with the actual HD44780 -- can we double-check > the HD44780 still works as expected? > > Cc'ing Lars and Geert since they may be able to give it a quick test. Hi Miguel, I do not have a standard Hitachi controller to test it on, so lets wait for feedback from Lars and Geert or others. > > + /* > > + * Some LCDs (ex: NewHaven) do not reset the DDRAM address when > > + * executing the CLEAR_DISPLAY command. Explicitely move cursor > > + * to home position to account for these non-standard LCDs: > > + */ > > + return hd44780_common_home(lcd); > > Few nits: > > - Explicitely -> Explicitly. > - Isn't the command `DISPLAY_CLEAR` instead of `CLEAR_DISPLAY`? (at > least the identifier above is `LCD_CMD_DISPLAY_CLEAR`). Yes, I have also modified the commit log message to be consistent with the code. > - `:` -> `.`. > What about something like: > > The Hitachi HD44780 controller (and compatible ones) reset the > DDRAM address when executing the `DISPLAY_CLEAR` command, thus the > following call is not required. However, other controllers do not > (e.g. NewHaven NHD-0220DZW-AG5), thus move the cursor to home > unconditionally to support both. Ok, changed comments to that. Thank you, Hugo.