Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8152321ybi; Thu, 6 Jun 2019 07:33:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSzCk+w+UmL7MkPbcc1qUlhzjZ9TmjZvkj2pPCXyDN8c/us1okrd8jkCUXfwpoPil5swGq X-Received: by 2002:a17:902:2889:: with SMTP id f9mr4911197plb.230.1559831603128; Thu, 06 Jun 2019 07:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559831603; cv=none; d=google.com; s=arc-20160816; b=Fs/fdsYldiufInDAiNgeY9wrljPxJrYEXjBZx2lQu6GgCx6hiNv3zhq7A3qeMjvGTb jHvCugDVxBNbzhZT4/b1UmKZ37QtRWQ2nRuyshWQ3TMlMLY6BjcIXt7N/vY/Pjs2TPFI HCamN06qY2aY3o7vjeWHDtjDqpHw4dRwxs6IF28S2rckDXCT9MbH2hsjS/28OgiSr/j5 38iYT1tXnkrx/HKK4KlGnRvBy3IGB3Y/WfXToX0y7QtvOULYgR7XKob8FBRLlygF8zym VML4hNJ0FFvjFfLOQvAxmGr1704xAVkKzkdFhPIHYN65EH4QILMv/3Lx3G261MVHAVzk 3TPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D1TlIMlDwkUd8JmwTcK9HfNS7g740uTj8TbJjCd+MwA=; b=rpx4HEnU1YEdUhlZ5J1XxgYDY604VwOOe2h9cS04tsMQLTu30/1PE50skhBtO+65mu GKgutpiBUrZBg7hxfgz7G5dZOe1yfrd1laikjUNMYE4Eg6PlUM6Bk+WDbEHqap6MiEvf o/O9VmLGOEj7TJdhcjyjMI6VR8ucOhIFgTZlK0IGZDwm5sqQdGiJL56Y52tW8C3BQCSc U+xt2zpKpbL6TTLeUpknxk7CZJQqccAqHiORKl8wDkzV4z5fKD/k9B/OGQsJZvP9m7xN dc7qQJknw0wcv1vMhAjK1nfvNh0gmIMaUocW6Hb2z2lxMwvqGOJ7T7nferYz3nEl4EmY JHYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f91si2041021plf.300.2019.06.06.07.33.07; Thu, 06 Jun 2019 07:33:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729038AbfFFObO (ORCPT + 99 others); Thu, 6 Jun 2019 10:31:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:49886 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727133AbfFFObO (ORCPT ); Thu, 6 Jun 2019 10:31:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 537DCAFDB; Thu, 6 Jun 2019 14:31:12 +0000 (UTC) From: Nicolas Saenz Julienne To: stefan.wahren@i2se.com, linux-kernel@vger.kernel.org Cc: mbrugger@suse.de, viresh.kumar@linaro.org, rjw@rjwysocki.net, sboyd@kernel.org, eric@anholt.net, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, ptesarik@suse.com, linux-rpi-kernel@lists.infradead.org, ssuloev@orpaltech.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mturquette@baylibre.com, linux-pm@vger.kernel.org, Nicolas Saenz Julienne Subject: [PATCH v2 5/7] clk: raspberrypi: register platform device for raspberrypi-cpufreq Date: Thu, 6 Jun 2019 16:22:58 +0200 Message-Id: <20190606142255.29454-6-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190606142255.29454-1-nsaenzjulienne@suse.de> References: <20190606142255.29454-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As 'clk-raspberrypi' depends on RPi's firmware interface, which might be configured as a module, the cpu clock might not be available for the cpufreq driver during it's init process. So we register the 'raspberrypi-cpufreq' platform device after the probe sequence succeeds. Signed-off-by: Nicolas Saenz Julienne Acked-by: Eric Anholt --- drivers/clk/bcm/clk-raspberrypi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c index b1365cf19f3a..052296b5fbe4 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -63,6 +63,8 @@ struct raspberrypi_firmware_prop { __le32 disable_turbo; } __packed; +static struct platform_device *rpi_cpufreq; + static int raspberrypi_clock_property(struct rpi_firmware *firmware, u32 tag, u32 clk, u32 *val) { @@ -285,6 +287,17 @@ static int raspberrypi_clk_probe(struct platform_device *pdev) return ret; } + rpi_cpufreq = platform_device_register_data(dev, "raspberrypi-cpufreq", + -1, NULL, 0); + + return 0; +} + +static int raspberrypi_clk_remove(struct platform_device *pdev) +{ + platform_device_unregister(rpi_cpufreq); + rpi_cpufreq = NULL; + return 0; } @@ -293,6 +306,7 @@ static struct platform_driver raspberrypi_clk_driver = { .name = "raspberrypi-clk", }, .probe = raspberrypi_clk_probe, + .remove = raspberrypi_clk_remove, }; module_platform_driver(raspberrypi_clk_driver); -- 2.21.0