Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4029683imm; Mon, 25 Jun 2018 08:34:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK5BiXdlemAu+9OhQ+SNYvE5dI4jbYdClb2z/u3Q80PFF+Rlv0XubvcyYwC44dChhi7ossZ X-Received: by 2002:aa7:83d1:: with SMTP id j17-v6mr13715696pfn.236.1529940876489; Mon, 25 Jun 2018 08:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529940876; cv=none; d=google.com; s=arc-20160816; b=qLa3SjVSdU/MwFUcFtc94hDZxs0CyjmPzGoPeWskbDBKNL5hIRd6MqQgbo2XTAL6hw K6ybeN5GyPGzXd5T31UzMxMvU+FAQPkepht4+ZiRRZGob+nYIylfDsOxKKEfY32SVk2G B25nw6ee+gMIohM6yK6KUkG12oPo1/wT8yN+oWtGA+PAn8aNMc3qitVR1kPCxE7fFkb6 FIhkeZTAm5SBvjPLNoL+R9aDRQXvEg4zEOHnLdyxwnKN1ib+1NExfGJ1CUrzPy6DaFbb BOJ2R534MzE00PXkCzlJsdBe8mC4OwuEn0nnbPKRHl94Nca53o90dtpupEW5C184JfMY WxwQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=CiUn2dABTighvoSOIP6hPSSRi5CXDgyrOQ/6nT40au4=; b=PhwRqLjaWx35DX2B73/wRmi3wGhrZus7jqtZyAI05gD3EQ87VdEhvOC0FZGaHbqlxu 3/SAlYZ3fLpQLw6i4L2dPlHWB3Op0sVeDEKVN04hv6xR9f+L/pGzLpDZG60LVrj9om31 puUWvUPwPL658hJL3wOzy9zHK1K9cgLn/I5YJX1qO9VaC99b0kLxaI0B7FboBYfD96cV cCZo5dR/mn8dDyWA0QNVXCxeRBdAOPS8FNSH6iVz5Um/U8teESvZjanPpLeqLOUFK49j hC81sASyola+YwnvXSjHf/2HG9O8cR1SRiaiHAgSVGlT0xJXmrQ2JI5E19ldD1v1KAyN ZyUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qE4oUvR5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si13474633pfn.245.2018.06.25.08.34.21; Mon, 25 Jun 2018 08:34:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qE4oUvR5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752139AbeFYPdi (ORCPT + 99 others); Mon, 25 Jun 2018 11:33:38 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:37217 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751037AbeFYPdg (ORCPT ); Mon, 25 Jun 2018 11:33:36 -0400 Received: by mail-pf0-f196.google.com with SMTP id y5-v6so6628534pfn.4; Mon, 25 Jun 2018 08:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CiUn2dABTighvoSOIP6hPSSRi5CXDgyrOQ/6nT40au4=; b=qE4oUvR5OOj2zuUa2uo0253+x9hPIfBd3/ICrahOH5Qvnt56gUftzQuCF3bP1m4sNj RTkNR5uXbGZRBD2XQGUyclWgy68KQqNjKpYcMKnu2o38CMko1KNOJwUz53Ta7gF6Tfo/ QbtcI95DmY5/XyGQq36l5yU4ocuSSRApCO4mUSqaLplQYEVGL7tXPormbIFSoFlffc3I QrY4WOLHjkn745AoVSUSH0Z15LUJAVhpNMi7PQy/PdiA4KqnCUmvSQTFSZXxqcZJ33To ykaZGbIrVsoMMLtgbjbgZiwWafFxm8k1AWRWphBKRfb+7jk/UqX1re56yEIPALA37ek1 6aFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=CiUn2dABTighvoSOIP6hPSSRi5CXDgyrOQ/6nT40au4=; b=q07FaRhdSOsdb5paL/PVnbW3dA/TygkP8H8A5ESKniqqb5XAl86h5LHPaVRtYKJf4p AAXpPDpCYeL4baT55om+RM36CC4vwBHdNqFa6skoUYxugAMuvga7LZqSJKVM8DHMmOCq GiKnHKYMEu6YuUdpozQ48ULKqjFzEYLg0WkzODl+9mJwqEYj/Yox4N1GUzw1h2g7rVWP v0MeIU8MrDWgaaI5MeNmkz2jdY5Ldgs2Z7RajBdvkt7KlpeGAOa+QoTPlJg5dohvdZFv Cj+r5YpnYAyGab/aq+OtHWPyLvq/dMAz6s2tTLbgO8e04jr32aQXzDiW5l1by2tsTUjX 0sVg== X-Gm-Message-State: APt69E2h6y5LCd+F4q7OyitX0cFTEpBh/Y70qusTGLrOP+3xsck9rGF9 QvTQD/0lzAWPIBYPOAJVFk8= X-Received: by 2002:a62:dc8d:: with SMTP id c13-v6mr5717923pfl.183.1529940815640; Mon, 25 Jun 2018 08:33:35 -0700 (PDT) Received: from ziggy.stardust ([37.223.136.20]) by smtp.gmail.com with ESMTPSA id w3-v6sm27659369pfi.109.2018.06.25.08.33.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:33:34 -0700 (PDT) Subject: Re: [v3 03/10] mfd: mtk-mmsys: Add mmsys driver To: Lee Jones , matthias.bgg@kernel.org Cc: ulrich.hecht+renesas@gmail.com, laurent.pinchart@ideasonboard.com, ck.hu@mediatek.com, p.zabel@pengutronix.de, airlied@linux.ie, robh+dt@kernel.org, mark.rutland@arm.com, mturquette@baylibre.com, sboyd@codeaurora.org, davem@davemloft.net, gregkh@linuxfoundation.org, mchehab@kernel.org, rdunlap@infradead.org, sean.wang@mediatek.com, linux-clk@vger.kernel.org, linux@armlinux.org.uk, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger References: <20180430101826.GC5147@dell> From: Matthias Brugger Openpgp: preference=signencrypt Autocrypt: addr=matthias.bgg@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFP1zgUBEAC21D6hk7//0kOmsUrE3eZ55kjc9DmFPKIz6l4NggqwQjBNRHIMh04BbCMY fL3eT7ZsYV5nur7zctmJ+vbszoOASXUpfq8M+S5hU2w7sBaVk5rpH9yW8CUWz2+ZpQXPJcFa OhLZuSKB1F5JcvLbETRjNzNU7B3TdS2+zkgQQdEyt7Ij2HXGLJ2w+yG2GuR9/iyCJRf10Okq gTh//XESJZ8S6KlOWbLXRE+yfkKDXQx2Jr1XuVvM3zPqH5FMg8reRVFsQ+vI0b+OlyekT/Xe 0Hwvqkev95GG6x7yseJwI+2ydDH6M5O7fPKFW5mzAdDE2g/K9B4e2tYK6/rA7Fq4cqiAw1+u EgO44+eFgv082xtBez5WNkGn18vtw0LW3ESmKh19u6kEGoi0WZwslCNaGFrS4M7OH+aOJeqK fx5dIv2CEbxc6xnHY7dwkc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B0uo9CzCSm3I++aYozF25xQoT+7zCx2cQi33jwvnJAK1o4VlNx36RfrxzBqc1uZGzJBCQu4 8UjmUSsTwWC3HpE/D9sM+xACs803lFUIZC5H62G059cCPAXKgsFpNMKmBAWweBkVJAisoQeX 50OP+/11ArV0cv+fOTfJj0/KwFXJaaYh3LUQNILLBNxkSrhCLl8dUg53IbHx4NfIAgqxLWGf XM8DY1aFdU79pac005PuhxCWkKTJz3gCmznnoat4GCnL5gy/m0Qk45l4PFqwWXVLo9AQg2Kp 3mlIFZ6fsEKIAN5hxlbNvNb9V2Zo5bFZjPWPFTxOteM0omUAS+QopwU0yPLLGJVf2iCmItHc UXI+r2JwH1CJjrHWeQEI2ucSKsNa8FllDmG/fQ== Message-ID: <5269ccfd-0274-3c12-7eeb-5de923197d92@gmail.com> Date: Mon, 25 Jun 2018 17:33:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180430101826.GC5147@dell> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/04/18 12:18, Lee Jones wrote: > On Fri, 27 Apr 2018, matthias.bgg@kernel.org wrote: > >> From: Matthias Brugger >> >> The MMSYS subsystem includes clocks and drm components. >> This patch adds a MFD device to probe both drivers from the same >> device tree compatible. >> >> Signed-off-by: Matthias Brugger >> --- >> drivers/mfd/Kconfig | 9 ++++++ >> drivers/mfd/Makefile | 2 ++ >> drivers/mfd/mtk-mmsys.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ >> 3 files changed, 90 insertions(+) >> create mode 100644 drivers/mfd/mtk-mmsys.c >> >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig >> index b860eb5aa194..d23a3b9a2c58 100644 >> --- a/drivers/mfd/Kconfig >> +++ b/drivers/mfd/Kconfig >> @@ -378,6 +378,15 @@ config MFD_MC13XXX_I2C >> help >> Select this if your MC13xxx is connected via an I2C bus. >> >> +config MFD_MEDIATEK_MMSYS >> + tristate "Mediatek MMSYS interface" >> + select MFD_CORE >> + select REGMAP_MMIO >> + help >> + Select this if you have a MMSYS subsystem in your SoC. The >> + MMSYS subsystem has at least a clock driver part and some >> + DRM components. >> + >> config MFD_MXS_LRADC >> tristate "Freescale i.MX23/i.MX28 LRADC" >> depends on ARCH_MXS || COMPILE_TEST >> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile >> index d9d2cf0d32ef..b96118bd68d9 100644 >> --- a/drivers/mfd/Makefile >> +++ b/drivers/mfd/Makefile >> @@ -98,6 +98,8 @@ obj-$(CONFIG_MFD_MC13XXX) += mc13xxx-core.o >> obj-$(CONFIG_MFD_MC13XXX_SPI) += mc13xxx-spi.o >> obj-$(CONFIG_MFD_MC13XXX_I2C) += mc13xxx-i2c.o >> >> +obj-$(CONFIG_MFD_MEDIATEK_MMSYS) += mtk-mmsys.o >> + >> obj-$(CONFIG_MFD_CORE) += mfd-core.o >> >> obj-$(CONFIG_EZX_PCAP) += ezx-pcap.o >> diff --git a/drivers/mfd/mtk-mmsys.c b/drivers/mfd/mtk-mmsys.c >> new file mode 100644 >> index 000000000000..c802343fb1c6 >> --- /dev/null >> +++ b/drivers/mfd/mtk-mmsys.c >> @@ -0,0 +1,79 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> + >> +/* >> + * mtk-mmsys.c -- Mediatek MMSYS multi-function driver >> + * >> + * Copyright (c) 2018 Matthias Brugger >> + * >> + * Author: Matthias Brugger >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +enum { >> + MMSYS_MT2701 = 1, >> +}; >> + >> +static const struct mfd_cell mmsys_mt2701_devs[] = { >> + { .name = "clk-mt2701-mm", }, >> + { .name = "drm-mt2701-mm", }, >> +}; >> + >> +static int mmsys_probe(struct platform_device *pdev) >> +{ >> + const struct mfd_cell *mmsys_cells; >> + int nr_cells; >> + long id; >> + int ret; >> + >> + id = (long) of_device_get_match_data(&pdev->dev); >> + if (!id) { >> + dev_err(&pdev->dev, "of_device_get match_data() failed\n"); >> + return -EINVAL; >> + } >> + >> + switch (id) { >> + case MMSYS_MT2701: >> + mmsys_cells = mmsys_mt2701_devs; >> + nr_cells = ARRAY_SIZE(mmsys_mt2701_devs); >> + break; >> + default: >> + return -ENODEV; >> + } >> + >> + ret = devm_mfd_add_devices(&pdev->dev, 0, mmsys_cells, nr_cells, >> + NULL, 0, NULL); >> + if (ret) { >> + dev_err(&pdev->dev, "failed to add MFD devices %d\n", ret); >> + return ret; >> + } >> + >> + return 0; >> +}; > > This driver is pretty pointless. It doesn't actually do anything. > > I think you just want to use "simple-mfd" instead. > I think the problem is, that right now we have two drivers which use the same devicetree binding, which are clk and drm driver. With a simple-mfd we would need two compatibles, and this would break backwards compatibility. Regards, Matthias