From patchwork Mon Oct 1 18:22:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 977371 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42P9m05X5Bz9s3l for ; Tue, 2 Oct 2018 04:29:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 224CAC21FB4; Mon, 1 Oct 2018 18:26:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1214EC21FCC; Mon, 1 Oct 2018 18:23:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C0727C21FB0; Mon, 1 Oct 2018 18:23:26 +0000 (UTC) Received: from mail-io1-f73.google.com (mail-io1-f73.google.com [209.85.166.73]) by lists.denx.de (Postfix) with ESMTPS id 85A2DC21FB6 for ; Mon, 1 Oct 2018 18:23:15 +0000 (UTC) Received: by mail-io1-f73.google.com with SMTP id x7-v6so14232490iop.20 for ; Mon, 01 Oct 2018 11:23:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=lnxE6Gvbrd6wGPXbfF9qwt+pp5L8F5yf8GrqNHyQgDI=; b=DyEE0n2jYLB06eseJuASTXoeZMZXvaLak58Iq7nfFTGE+37EyATs4TGstSgjJmtTVE bfRcwcPvIUKATh6SS1OwrTz/wRW2dJqg5aIDg2xd3AD8kKDE3LejhQXr/JGkCk7KlxN0 2aSzQyu1jZh2QW4ua1FM4ULTIv5DGVrio8Mtii9qwVEkG354NohKAj6C1h1fDFPwC9yD OZc4DdiQVkjuz+PIYbZcjHP/KR88oHeOWdCXR/ju0RuGlDVukibSte/U/joPIwaGmCIV CykrK22NJqTz4LSrXooTPUIRSAESNGVy/Z+qqgike8Apcmx5XD9M37+t+JdD3CTwWbeq zrTg== X-Gm-Message-State: ABuFfogyJ2QXxidTHEwsY6aajEimnKOT3XBgxZ4fdM8Ph052jpD90T5h VyFJ8BnZOnLHLyxGEmOdNcOLERM= X-Google-Smtp-Source: ACcGV63lMpVSOXp5HmOcYtQIt7Vnte0uLJcutaxSEwA7nFLgCBQNDovz1wVUxvQ0uXRQuqYhZltMxAM= X-Received: by 2002:a24:7dcb:: with SMTP id b194-v6mr2071746itc.18.1538418194549; Mon, 01 Oct 2018 11:23:14 -0700 (PDT) Date: Mon, 1 Oct 2018 12:22:10 -0600 In-Reply-To: <20181001182249.129565-1-sjg@chromium.org> Message-Id: <20181001182249.129565-7-sjg@chromium.org> Mime-Version: 1.0 References: <20181001182249.129565-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog From: Simon Glass To: U-Boot Mailing List Subject: [U-Boot] [PATCH 06/45] spl: input: Allow input in SPL and TPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" In some cases it is necessary to read the keyboard in early phases of U-Boot. Update the config to allow this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- drivers/input/Kconfig | 48 ++++++++++++++++++++++++++++++++++++++++++ drivers/input/Makefile | 11 ++++++---- drivers/input/input.c | 5 ++++- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index 7ffb949f12d..7afdafed948 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -1,3 +1,16 @@ +config INPUT + bool "Enable input subsystem" + depends on DM + default y + +config SPL_INPUT + bool "Enable input subsystem for SPL" + depends on SPL_DM + +config TPL_INPUT + bool "Enable input subsystem for TPL" + depends on TPL_DM + config DM_KEYBOARD bool "Enable driver model keyboard support" depends on DM @@ -7,8 +20,43 @@ config DM_KEYBOARD includes methods to start/stop the device, check for available input and update LEDs if the keyboard has them. +config SPL_DM_KEYBOARD + bool "Enable driver model keyboard support" + depends on SPL_DM + help + This adds a uclass for keyboards and implements keyboard support + using driver model. The API is implemented by keyboard.h and + includes methods to start/stop the device, check for available + input and update LEDs if the keyboard has them. + +config TPL_DM_KEYBOARD + bool "Enable driver model keyboard support" + depends on TPL_DM + help + This adds a uclass for keyboards and implements keyboard support + using driver model. The API is implemented by keyboard.h and + includes methods to start/stop the device, check for available + input and update LEDs if the keyboard has them. + config CROS_EC_KEYB bool "Enable Chrome OS EC keyboard support" + depends on INPUT + help + Most ARM Chromebooks use an EC to provide access to the keyboard. + Messages are used to request key scans from the EC and these are + then decoded into keys by this driver. + +config SPL_CROS_EC_KEYB + bool "Enable Chrome OS EC keyboard support in SPL" + depends on SPL_INPUT + help + Most ARM Chromebooks use an EC to provide access to the keyboard. + Messages are used to request key scans from the EC and these are + then decoded into keys by this driver. + +config TPL_CROS_EC_KEYB + bool "Enable Chrome OS EC keyboard support in TPL" + depends on TPL_INPUT help Most ARM Chromebooks use an EC to provide access to the keyboard. Messages are used to request key scans from the EC and these are diff --git a/drivers/input/Makefile b/drivers/input/Makefile index d13baf3576a..fd56d7b3492 100644 --- a/drivers/input/Makefile +++ b/drivers/input/Makefile @@ -3,12 +3,15 @@ # (C) Copyright 2000-2007 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. -obj-$(CONFIG_DM_KEYBOARD) += keyboard-uclass.o +obj-y += input.o +obj-$(CONFIG_$(SPL_TPL_)CROS_EC_KEYB) += cros_ec_keyb.o +obj-$(CONFIG_$(SPL_TPL_)OF_CONTROL) += key_matrix.o +obj-$(CONFIG_$(SPL_TPL_)DM_KEYBOARD) += keyboard-uclass.o + +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_I8042_KEYB) += i8042.o obj-$(CONFIG_TEGRA_KEYBOARD) += tegra-kbc.o obj-$(CONFIG_TWL4030_INPUT) += twl4030.o obj-$(CONFIG_TWL6030_INPUT) += twl6030.o -obj-$(CONFIG_CROS_EC_KEYB) += cros_ec_keyb.o -obj-y += input.o -obj-$(CONFIG_$(SPL_)OF_CONTROL) += key_matrix.o +endif diff --git a/drivers/input/input.c b/drivers/input/input.c index 29620a9e279..4f514dba56d 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -652,7 +652,7 @@ int input_stdio_register(struct stdio_dev *dev) int error; error = stdio_register(dev); - +#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(ENV_SUPPORT) /* check if this is the standard input device */ if (!error && strcmp(env_get("stdin"), dev->name) == 0) { /* reassign the console */ @@ -660,6 +660,9 @@ int input_stdio_register(struct stdio_dev *dev) console_assign(stdin, dev->name)) return -1; } +#else + error = error; +#endif return 0; }