From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BC38EB64D9 for ; Thu, 6 Jul 2023 19:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbjGFTtr (ORCPT ); Thu, 6 Jul 2023 15:49:47 -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 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.