Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp628359ybz; Wed, 15 Apr 2020 15:27:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJ5CCCHjNtal28Zrzw37ZwDVaJS5f0bUtI/fgDcog2ZyR19oGEjeCYITAeERWPDv9vtNlf7 X-Received: by 2002:aa7:c90d:: with SMTP id b13mr10874014edt.14.1586989655627; Wed, 15 Apr 2020 15:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586989655; cv=none; d=google.com; s=arc-20160816; b=IZ/QVEEf28kBf9wlaRPeoJw7NkZa4IQUdMn+1zzXWMkq3t8pRA/6s/T1AL3fWMO3y7 UwLOfgAbSJm8xt9hUc0XDQckP1WvS+mKe3yl5gWMg1Xr4TapC8h04oEezZ08T2vKz2DR 9uJZz3xeddQgWAThcHYENU2vzIQJiVvSw7/a+ryJXoWc3K3p2I6JjwbcZoBQGPebA/9J 9/315UtuFC4DKsAfh9tpZufiP5VAnYRW3bl+JRnLeaCE0YhAeqwJtDPqBs++yjnBsSUh 2omPaC2HA8iApbhxMS0lwmeFKYMkylhJt3zVlXrKhhwD22Xf5WyFNhV1H7o5JCm7ZXL2 HCWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Xb9qOov31+pg58uEzA+MJndnBYJVfpF7eKAUQluudNY=; b=t2MZ3q9h/xTp5bSAmZPabjXjAqKTf6Up0mn49JmbsWdCJbCNbKExOW1johnTfm7Ucj Ca/MGZWsyeodFv2ujpJt9vLFSg4Su+WenVdYYHUB/9UNcHPMH6QxF9WhYN4S6nJGfkHY +EzRzwd6mTw5kVK4LwjTo+B21M6tNFt9R/IyLtHiJpckxfBXjWnne8tgdwZTE5eDpPs1 7iv4/wB+VLJQUjDoBt9QncrzZ/hf7+e2uZnaDBk4+GaUwDbDORO0no9mfXWEnSL05spk l//NvatWP/EHRnx4zl3zT9vvVxc+zaYyqIJtg8jCO87fYEG5n5o+enbq7RVhPMd3dCZf wWqw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv23si9698752ejb.330.2020.04.15.15.27.12; Wed, 15 Apr 2020 15:27:35 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2635535AbgDOIGk (ORCPT + 99 others); Wed, 15 Apr 2020 04:06:40 -0400 Received: from inva020.nxp.com ([92.121.34.13]:39724 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408042AbgDOID2 (ORCPT ); Wed, 15 Apr 2020 04:03:28 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 065C51A079B; Wed, 15 Apr 2020 10:03:06 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ED3BE1A079F; Wed, 15 Apr 2020 10:03:05 +0200 (CEST) Received: from fsr-ub1664-175.ea.freescale.net (fsr-ub1664-175.ea.freescale.net [10.171.82.40]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 5E8DC202B0; Wed, 15 Apr 2020 10:03:05 +0200 (CEST) From: Abel Vesa To: Lee Jones , Shawn Guo , Peng Fan , Philipp Zabel , Stephen Boyd , Sascha Hauer , Anson Huang , Leonard Crestez , Jacky Bai Cc: NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [PATCH v3 01/13] mfd: Add i.MX generic mix support Date: Wed, 15 Apr 2020 11:02:41 +0300 Message-Id: <1586937773-5836-2-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586937773-5836-1-git-send-email-abel.vesa@nxp.com> References: <1586937773-5836-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of the i.MX SoCs have a IP for interfacing the dedicated IPs with clocks, resets and interrupts, plus some other specific control registers. To allow the functionality to be split between drivers, this MFD driver is added that has only two purposes: register the devices and map the entire register addresses. Everything else is left to the dedicated drivers that will bind to the registered devices. Signed-off-by: Abel Vesa --- drivers/mfd/Kconfig | 11 +++++++++++ drivers/mfd/Makefile | 1 + drivers/mfd/imx-mix.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 drivers/mfd/imx-mix.c diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 0a59249..7eeb17f 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -460,6 +460,17 @@ config MFD_MX25_TSADC i.MX25 processors. They consist of a conversion queue for general purpose ADC and a queue for Touchscreens. +config MFD_IMX_MIX + tristate "NXP i.MX Generic Mix Control Driver" + depends on OF || COMPILE_TEST + help + Enable generic mixes support. On some i.MX platforms, there are + devices that are a mix of multiple functionalities like reset + controllers, clock controllers and some others. In order to split + those functionalities between the right drivers, this MFD populates + with virtual devices based on what's found in the devicetree node, + leaving the rest of the behavior control to the dedicated driver. + config MFD_HI6421_PMIC tristate "HiSilicon Hi6421 PMU/Codec IC" depends on OF diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index f935d10..5b2ae5d 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -113,6 +113,7 @@ obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o obj-$(CONFIG_TWL6040_CORE) += twl6040.o obj-$(CONFIG_MFD_MX25_TSADC) += fsl-imx25-tsadc.o +obj-$(CONFIG_MFD_IMX_MIX) += imx-mix.o obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o obj-$(CONFIG_MFD_MC13XXX_SPI) += mc13xxx-spi.o diff --git a/drivers/mfd/imx-mix.c b/drivers/mfd/imx-mix.c new file mode 100644 index 00000000..4ea456f --- /dev/null +++ b/drivers/mfd/imx-mix.c @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2019 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static int imx_mix_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct resource *res; + void __iomem *base; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + base = devm_ioremap_resource(dev, res); + if (IS_ERR(base)) + return PTR_ERR(base); + + dev_set_drvdata(dev, base); + + return devm_of_platform_populate(dev); +} + +static const struct of_device_id imx_mix_of_match[] = { + { .compatible = "fsl,imx8mp-mix" }, + { /* Sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, imx_mix_of_match); + +static struct platform_driver imx_mix_driver = { + .probe = imx_mix_probe, + .driver = { + .name = "imx-mix", + .of_match_table = of_match_ptr(imx_mix_of_match), + }, +}; +module_platform_driver(imx_mix_driver); -- 2.7.4