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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E3F5C433EF for ; Thu, 3 Feb 2022 18:40:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C1D783090; Thu, 3 Feb 2022 19:39:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="pHlW4NAm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 167C6836C3; Thu, 3 Feb 2022 19:39:58 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB9DA81DCA for ; Thu, 3 Feb 2022 19:39:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 11ED8618E3; Thu, 3 Feb 2022 18:39:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FB70C340E8; Thu, 3 Feb 2022 18:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643913592; bh=fEDdy87q9Iot3Fx27X6ZZYTYgkzdE/MJxm+FOM3kQ8M=; h=From:To:Cc:Subject:Date:From; b=pHlW4NAmZd+jv3TenrZCp1AMLeVbG4J/uTu2Bv++aEH/D1AtGOmTojdyQeqtDSvSp mG93ZDKv3Je/el9y0cyrdAzhxE2SAlv4ozlGpIg3rDRkiRHtb6Oa1WDCZm+kScCQW1 bJesH1s4+getvI9pr0gqCxpuep+3mpidkAn+XGPo9E2jb2sZ7hP2mIAZqvWbczABSx iATO4QpWZEnfqWk0YOF2OKKwIBRK2ZS6cmnQjnka9YXMtTgdDuNjd/b4ziQM1zlsgW JuIyZlvYuRrgHKwE6aZQ9eIqFcJL7J/7SInzmWws4IEn+7uVGY9lvFxhsZeqeWR3Ld bVZaY0Wm5ooVA== Received: by pali.im (Postfix) id A3B89889; Thu, 3 Feb 2022 19:39:49 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Tom Rini Cc: u-boot@lists.denx.de Subject: [PATCH] Nokia RX-51: Convert to CONFIG_DM_KEYBOARD Date: Thu, 3 Feb 2022 19:38:50 +0100 Message-Id: <20220203183850.10186-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Pali Rohár --- I would really appreciate if U-Boot test framework starts printing deprecation warnings, instead of sending patches which directly drop support for some boards. There is absolutely no warning during building U-Boot for RX-51 board that this board has not been converted to DM_KEYBOARD yet. --- board/nokia/rx51/rx51.c | 37 +++++++++++++++++++++++++++++++----- configs/nokia_rx51_defconfig | 2 +- include/configs/nokia_rx51.h | 13 +------------ 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c index 99ca36fbbea1..a52691509da4 100644 --- a/board/nokia/rx51/rx51.c +++ b/board/nokia/rx51/rx51.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -579,10 +580,10 @@ static u8 keybuf_head; static u8 keybuf_tail; /* - * Routine: rx51_kp_init + * Routine: rx51_kp_start * Description: Initialize HW keyboard. */ -int rx51_kp_init(void) +static int rx51_kp_start(struct udevice *dev) { int ret = 0; u8 ctrl; @@ -656,7 +657,7 @@ static void rx51_kp_fill(u8 k, u8 mods) * Routine: rx51_kp_tstc * Description: Test if key was pressed (from buffer). */ -int rx51_kp_tstc(struct stdio_dev *sdev) +static int rx51_kp_tstc(struct udevice *dev) { u8 c, r, dk, i; u8 intr; @@ -712,14 +713,36 @@ int rx51_kp_tstc(struct stdio_dev *sdev) * Routine: rx51_kp_getc * Description: Get last pressed key (from buffer). */ -int rx51_kp_getc(struct stdio_dev *sdev) +static int rx51_kp_getc(struct udevice *dev) { keybuf_head %= KEYBUF_SIZE; - while (!rx51_kp_tstc(sdev)) + while (!rx51_kp_tstc(dev)) WATCHDOG_RESET(); return keybuf[keybuf_head++]; } +static int rx51_kp_probe(struct udevice *dev) +{ + struct keyboard_priv *uc_priv = dev_get_uclass_priv(dev); + struct stdio_dev *sdev = &uc_priv->sdev; + + strcpy(sdev->name, "keyboard"); + return input_stdio_register(sdev); +} + +static const struct keyboard_ops rx51_kp_ops = { + .start = rx51_kp_start, + .tstc = rx51_kp_tstc, + .getc = rx51_kp_getc, +}; + +U_BOOT_DRIVER(rx51_kp) = { + .name = "rx51_kp", + .id = UCLASS_KEYBOARD, + .probe = rx51_kp_probe, + .ops = &rx51_kp_ops, +}; + static const struct mmc_config rx51_mmc_cfg = { .host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS, .f_min = 400000, @@ -753,3 +776,7 @@ U_BOOT_DRVINFOS(rx51_i2c) = { U_BOOT_DRVINFOS(rx51_watchdog) = { { "rx51_watchdog" }, }; + +U_BOOT_DRVINFOS(rx51_kp) = { + { "rx51_kp" }, +}; diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig index 4a95f42e4eb4..47b7bc3b4f03 100644 --- a/configs/nokia_rx51_defconfig +++ b/configs/nokia_rx51_defconfig @@ -66,6 +66,7 @@ CONFIG_DM=y # CONFIG_DM_SEQ_ALIAS is not set # CONFIG_BLOCK_CACHE is not set CONFIG_DM_I2C=y +CONFIG_DM_KEYBOARD=y # CONFIG_MMC_HW_PARTITIONING is not set # CONFIG_MMC_VERBOSE is not set CONFIG_MMC_OMAP_HS=y @@ -78,7 +79,6 @@ CONFIG_USB_MUSB_UDC=y CONFIG_USB_OMAP3=y CONFIG_CFB_CONSOLE=y CONFIG_CFB_CONSOLE_ANSI=y -# CONFIG_VGA_AS_SINGLE_DEVICE is not set CONFIG_SPLASH_SCREEN=y CONFIG_WATCHDOG_TIMEOUT_MSECS=31000 CONFIG_WDT=y diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h index adfc055a2c9e..9be64c3d3f87 100644 --- a/include/configs/nokia_rx51.h +++ b/include/configs/nokia_rx51.h @@ -77,21 +77,10 @@ #define VIDEO_FB_16BPP_PIXEL_SWAP #define VIDEO_FB_16BPP_WORD_SWAP -/* functions for cfb_console */ -#define VIDEO_KBD_INIT_FCT rx51_kp_init() -#define VIDEO_TSTC_FCT rx51_kp_tstc -#define VIDEO_GETC_FCT rx51_kp_getc -#ifndef __ASSEMBLY__ -struct stdio_dev; -int rx51_kp_init(void); -int rx51_kp_tstc(struct stdio_dev *sdev); -int rx51_kp_getc(struct stdio_dev *sdev); -#endif - /* Environment information */ #define CONFIG_EXTRA_ENV_SETTINGS \ "usbtty=cdc_acm\0" \ - "stdin=usbtty,serial,vga\0" \ + "stdin=usbtty,serial,keyboard\0" \ "stdout=usbtty,serial,vga\0" \ "stderr=usbtty,serial,vga\0" \ "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \ -- 2.20.1