Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3189514ybf; Tue, 3 Mar 2020 01:05:17 -0800 (PST) X-Google-Smtp-Source: ADFU+vvpowg2KcS92EomaOtAnoRWweTleKQJH0y4JUQiq/EwPkkdwOmmKJ0dgogJe0XrtQ1Etg+Y X-Received: by 2002:a9d:4007:: with SMTP id m7mr2660908ote.268.1583226316998; Tue, 03 Mar 2020 01:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583226316; cv=none; d=google.com; s=arc-20160816; b=pyCagPK/aOnswpckkb4kztMHLcJj3cvOIXRduJqAZ4w1AtbEds94WtXTGs/cako3A6 PqqnAZcRHDTsBfCdHriV2E/RTlLqEdIKfcwOBOAd7EXFvHTJ9oXJt/+CIKD1l3glGeEw XSQYrobJD/0OfJdD4odntjfcQZcNbJx6nbdSCfWpXsFO96vZUo152DBcGrS+iG6rRlv1 ZBI4EKS6o5QDHqSkPTQENSbVXpw/Cy108d0Rsxbiwxn3loH5o6xwBz1NReGzC0t5VZQT qNEtwJDwCeeNjytfQbTzxG9b77MrTL1SLE0LWUXun8u/wMzMRPEh6qoJtyHG43uuAiov MHiw== 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=o0WpvFr/UzdkMee2xNSqtNcor+YEtFX/mWGzAoH8HKA=; b=IfEyVaeE50Ls+e+A3SQbxDMFvFHG0UPUCr0sxf86GWnnLaDGkJID0+VkGQKkkImOAB N7DcOA1EwXtuQnOxkq/MgFG9dTZtMTguhJSjBcvhG8EbUnFEGckc2EHD7/EGrP3a3qJs 2MMZ2E9Lc+jbmdAZwGxBQF2hp3kHsY1t5UAXY+vjbUB0mBKOSdlkzCIoZOYHtxsx7eSp rv5Se/cMe3mLeoiftHW7Utn9HI3nz9Es+LtUvgz/M2x1K1X+P//S4pvawnlE2POqkx9O uj+OBmGfTHIAJ/j4A/9Ox5TXbohwDhBy9nXtWyE3SucIEUbsmjwFR7XlBnLus0SLVeS5 hAuw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si5180851otm.71.2020.03.03.01.04.58; Tue, 03 Mar 2020 01:05:16 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbgCCJEU (ORCPT + 99 others); Tue, 3 Mar 2020 04:04:20 -0500 Received: from inva020.nxp.com ([92.121.34.13]:36372 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727644AbgCCJDk (ORCPT ); Tue, 3 Mar 2020 04:03:40 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A64831A145D; Tue, 3 Mar 2020 10:03:37 +0100 (CET) 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 8F9DD1A09DD; Tue, 3 Mar 2020 10:03:37 +0100 (CET) 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 7FF9420414; Tue, 3 Mar 2020 10:03:36 +0100 (CET) From: Abel Vesa To: Rob Herring , Shawn Guo , Sascha Hauer , Fabio Estevam , Mike Turquette , Stephen Boyd , Lee Jones , Anson Huang , Leonard Crestez , Peng Fan , Jacky Bai Cc: NXP Linux Team , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , linux-clk@vger.kernel.org, Abel Vesa Subject: [RFC 01/11] mfd: Add i.MX generic mix support Date: Tue, 3 Mar 2020 11:03:16 +0200 Message-Id: <1583226206-19758-2-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583226206-19758-1-git-send-email-abel.vesa@nxp.com> References: <1583226206-19758-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 3c547ed..3c89288 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..d3f8c71 --- /dev/null +++ b/drivers/mfd/imx-mix.c @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2019 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static int imx_audiomix_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_audiomix_of_match[] = { + { .compatible = "fsl,imx8mp-audiomix" }, + { /* Sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, imx_audiomix_of_match); + +static struct platform_driver imx_audiomix_driver = { + .probe = imx_audiomix_probe, + .driver = { + .name = "imx-audiomix", + .of_match_table = of_match_ptr(imx_audiomix_of_match), + }, +}; +module_platform_driver(imx_audiomix_driver); -- 2.7.4