From patchwork Tue Sep 29 07:23:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 523739 X-Patchwork-Delegate: thomas@wytron.com.tw Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CECD7140180 for ; Tue, 29 Sep 2015 17:24:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A25A4B8CF; Tue, 29 Sep 2015 09:24:20 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zk8rDP1spXm0; Tue, 29 Sep 2015 09:24:20 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D417A4B8D3; Tue, 29 Sep 2015 09:24:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B47B4B8C0 for ; Tue, 29 Sep 2015 09:24:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9lLuyZksggaw for ; Tue, 29 Sep 2015 09:24:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from www.wytron.com.tw (220-134-43-68.HINET-IP.hinet.net [220.134.43.68]) by theia.denx.de (Postfix) with ESMTP id B48B84B8C3 for ; Tue, 29 Sep 2015 09:24:04 +0200 (CEST) Received: from localhost.localdomain (unknown [192.168.1.250]) by www.wytron.com.tw (Postfix) with ESMTP id 401FBD0030A; Tue, 29 Sep 2015 15:24:02 +0800 (CST) From: Thomas Chou To: u-boot@lists.denx.de Date: Tue, 29 Sep 2015 15:23:57 +0800 Message-Id: <1443511438-18625-1-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 2.1.4 Cc: Marek Vasut , clsee@altera.com, lftan@altera.com Subject: [U-Boot] [PATCH 1/2] dm: implement a Miscellaneous uclass X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Implement a Miscellaneous uclass with generic read or write operations. This class is used only for those do not fit other more general classes. Signed-off-by: Thomas Chou --- drivers/misc/Kconfig | 6 ++++++ drivers/misc/Makefile | 1 + drivers/misc/misc-uclass.c | 14 ++++++++++++++ include/dm/uclass-id.h | 1 + 4 files changed, 22 insertions(+) create mode 100644 drivers/misc/misc-uclass.c diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 8b38a84..51c2a08 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -4,6 +4,12 @@ menu "Multifunction device drivers" +config DM_MISC + bool "Enable Driver Model for Misc drivers" + depends on DM + help + Enable driver model for miscellaneous devices. + config CMD_CROS_EC bool "Enable crosec command" depends on CROS_EC diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 8d0fc3c..b285946 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -5,6 +5,7 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-$(CONFIG_DM_MISC) += misc-uclass.o obj-$(CONFIG_ALI152X) += ali512x.o obj-$(CONFIG_DS4510) += ds4510.o obj-$(CONFIG_CBMEM_CONSOLE) += cbmem_console.o diff --git a/drivers/misc/misc-uclass.c b/drivers/misc/misc-uclass.c new file mode 100644 index 0000000..40fe947 --- /dev/null +++ b/drivers/misc/misc-uclass.c @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2010 Thomas Chou + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +UCLASS_DRIVER(misc) = { + .id = UCLASS_MISC, + .name = "misc", +}; diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index aff34a4..a6982ab 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -39,6 +39,7 @@ enum uclass_id { UCLASS_LED, /* Light-emitting diode (LED) */ UCLASS_LPC, /* x86 'low pin count' interface */ UCLASS_MASS_STORAGE, /* Mass storage device */ + UCLASS_MISC, /* Miscellaneous device */ UCLASS_MMC, /* SD / MMC card or chip */ UCLASS_MOD_EXP, /* RSA Mod Exp device */ UCLASS_PCH, /* x86 platform controller hub */