Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1243698pxb; Fri, 26 Feb 2021 06:17:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtLrNIsal47HXnxQpqslNB+WqXhOt08jpV8mnVViRvZ6pT/c0fjI50v9lQxiQ2glKTcqyW X-Received: by 2002:aa7:db88:: with SMTP id u8mr3540993edt.329.1614349063483; Fri, 26 Feb 2021 06:17:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614349063; cv=none; d=google.com; s=arc-20160816; b=yNBszCXQPOmUgBaLEk4mcVaBLC9RopZhwPXtwQjIJ194gPJFDMvDVl6/Qpf+CdoIjr qEMWflbLKFt3Bidxjfz1gjtDeWcMXPdx0PiXjwtCd+cjXqZkes9M2LVMMeUPjIeNcP35 KXDnL6Nd6+9n8Nl2ILCGMerIGyGAgZyO61GDYegZcTufHc7xprCBpObEe7Z7B7+U0SNf mN/PWYHAPcGIAY38IQNsvdMm9/mMIug4UN+CBz0Owfr71NNOT2mgLWN/h9oGwS7A76DQ Yq3nsZ/o1J5dQ0K+uds9CtRYFGWMj9yX5Fb1TPtSnZLByOhKevbWkNSowl9sMMGtVcZ3 sARw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fiQu2oPApg5uagXMeqvolPXEApCItlWJFjBIgQNcT+U=; b=f3cO2SYnrrjQ6JXMIQT+UWGIFRoOkiRmKSenXQHE23O8DRtY2qALFVYj7VPgRE/y3T 9ycUDee5UosLodA1E7BT9Yri8glpiSEYJrlDT+H8/u9vtZobpqrygl2AoSLKnqQh5o1X iKJQuAndnrsX/3uja5ptrFsVpuOZNAwza3Y2Sc3DTR5xB7UQzzR81Zt6OYZv+bAwUXOO FOxmnibOQhSbp5O8U6PhrasUMNRwei4ZM06QMyAspsJjwrcYCbaooYmWrlVkfoEoqi0P cOXVo2lH6JaExYvammLoTd6JbD7oE17ZTycLXDn0Dth6nMFP4AQOF7/CDdNLkZBoH6Ss ofQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=J5pKGpp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si6781992edj.219.2021.02.26.06.17.18; Fri, 26 Feb 2021 06:17:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=J5pKGpp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbhBZOQJ (ORCPT + 99 others); Fri, 26 Feb 2021 09:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbhBZOPp (ORCPT ); Fri, 26 Feb 2021 09:15:45 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3586FC06178C for ; Fri, 26 Feb 2021 06:14:18 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id d2so11097193edq.10 for ; Fri, 26 Feb 2021 06:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fiQu2oPApg5uagXMeqvolPXEApCItlWJFjBIgQNcT+U=; b=J5pKGpp119dXassFAQHDedxcYd25QkctzzdK/xuhuJiTm3yxPt1cK8uG+fpwUUdGy+ IiimOncJrA+KsZtTxqnEaWqkr/ahi005229VXf7F+d02ok7m5USrYAvviwADS1Fxzuay 2l1WLWwav6JcD1uEa0BWutnySL0uDe5xzN7BU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fiQu2oPApg5uagXMeqvolPXEApCItlWJFjBIgQNcT+U=; b=FNr+WJQmV1Y+0x1B0lnuR7E5J3fdHJwwfIfO2dO198F5zsmeuE80RY83cyLc22Y1pR 6n9lxE+PWFZ6vHlAPS8OrR5CgqBPVCdub9aTvX0AFPd5x6ECFVEHlR9ASbUuIu9gxaEY k0ud1eIhI9+umC/xttfyY3DuGhCzVO5dGv9v8HFUm/TdGnPH4j7MKtuPZugJl0drArGw qm1Phu9k8Kq5jHO5n5yaWUCFPmfjgPLEEbOj5MCO35180mxuTbQgTMXJB7nXnycXBbb0 Kl99wHfYR3LzoZrHS7T12rpbDFjxa2NBS3j4nIdsl+qWqjo7A8x6s1qNxs8DSASUmTFf UyBA== X-Gm-Message-State: AOAM531CBV2DZcyz/MoYB6UWuT6iChX2Fi8qCR3bXrMUPkD54DIujLnP agaZ54MR8teuZeL0C8nbtMRG9Q== X-Received: by 2002:aa7:d451:: with SMTP id q17mr3483756edr.381.1614348856948; Fri, 26 Feb 2021 06:14:16 -0800 (PST) Received: from prevas-ravi.prevas.se ([80.208.71.141]) by smtp.gmail.com with ESMTPSA id g3sm5316838ejz.91.2021.02.26.06.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 06:14:16 -0800 (PST) From: Rasmus Villemoes To: Greg Kroah-Hartman , Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , linux-clk@vger.kernel.org, Rasmus Villemoes Subject: [PATCH 2/2] drivers: misc: add ripple counter driver Date: Fri, 26 Feb 2021 15:14:11 +0100 Message-Id: <20210226141411.2517368-3-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210226141411.2517368-1-linux@rasmusvillemoes.dk> References: <20210226141411.2517368-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only purpose of this driver is to serve as a consumer of the input clock, to prevent it from being disabled by clk_disable_unused(). Signed-off-by: Rasmus Villemoes --- drivers/misc/Kconfig | 7 +++++++ drivers/misc/Makefile | 1 + drivers/misc/ripple-ctr.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 drivers/misc/ripple-ctr.c diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index f532c59bb59b..44b0b6ce42df 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -445,6 +445,13 @@ config HISI_HIKEY_USB switching between the dual-role USB-C port and the USB-A host ports using only one USB controller. +config RIPPLE_CTR + tristate "Trivial ripple counter driver" + help + This provides a stub driver for a ripple counter, whose + only purpose is to request and enable the clock source + driving the counter. + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 99b6f15a3c70..d560163068a9 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -56,3 +56,4 @@ obj-$(CONFIG_HABANA_AI) += habanalabs/ obj-$(CONFIG_UACCE) += uacce/ obj-$(CONFIG_XILINX_SDFEC) += xilinx_sdfec.o obj-$(CONFIG_HISI_HIKEY_USB) += hisi_hikey_usb.o +obj-$(CONFIG_RIPPLE_CTR) += ripple-ctr.o diff --git a/drivers/misc/ripple-ctr.c b/drivers/misc/ripple-ctr.c new file mode 100644 index 000000000000..f086eaf335df --- /dev/null +++ b/drivers/misc/ripple-ctr.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#include +#include +#include +#include +#include + +static int ripple_ctr_probe(struct platform_device *pdev) +{ + struct clk *clk; + + clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(clk)) + return PTR_ERR(clk); + return clk_prepare_enable(clk); +} + +static const struct of_device_id ripple_ctr_ids[] = { + { .compatible = "linux,ripple-counter", }, + { } +}; +MODULE_DEVICE_TABLE(of, ripple_ctr_ids); + +static struct platform_driver ripple_ctr_driver = { + .driver = { + .name = "ripple-counter", + .of_match_table = ripple_ctr_ids, + }, + .probe = ripple_ctr_probe, +}; +module_platform_driver(ripple_ctr_driver); -- 2.29.2