Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5646797rwl; Tue, 4 Apr 2023 01:16:44 -0700 (PDT) X-Google-Smtp-Source: AKy350bHHyKZuRWcXjLmuqrVKSNG6Ecg921uv2JRc4xua0i9BSDRN8yPKjiaalURMbNeKs1wWfSP X-Received: by 2002:a05:6402:215:b0:4ac:b431:4762 with SMTP id t21-20020a056402021500b004acb4314762mr1750935edv.23.1680596204658; Tue, 04 Apr 2023 01:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680596204; cv=none; d=google.com; s=arc-20160816; b=AWMs91+CSFmjDvNne9qxczgQRqybQR72T4Vo60AqZUToEZTdgZhHRJsKiKVFdKhoYl JxreFEbSqqzJIWR4SXjFOvy7ni7paTR4fjtFD5x3FKc0TgAKo4Bfu+51vg16d5ggJVe7 +y/FZFTjZpTfH5zF0ocIt5eFLDL+xWu0AI4r6Z9mQwlMUBSJqYUNE7qJ3SjQaNZyQTQV Fz8vZoWQQXbOziG0i7HKBqZnJCLz7DmxwDo8YU2NE2YBzL5Xh6nLGOntc2mhzVxxq0cy +ZeLCNIQZpQaKuqdp7QVBH2msCcB5ivssl4SvmWKedOlckQR5fTuorT9uKgJ1pzXWjCe LqDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IxmMKV3AzGJpb+DJfP0Ri3E5yjDAWlJf8T4Fjwm6+p0=; b=LF2Q5aBdzWofPMgpp7ZSE/ZMAhBVOh5gz/nArh0a2/+UjrBIuj69bqqvgB1YmW0kfP DmmpEGAFrRQcTuCYr/2JIVv5gbf9t/BEh0X0dMnhnY858V0fwQFdClUiV1nYY+r6yMlD cmHXEUv2yhY1ovzmfNcy8M7D8k0hCrHNh6nLe7GK2Wczp4D9wrQGPnIzH/w4IAFRwf+F nh9883+foFYYri2F6Pn74jURre5xOEF9BJpIW/lyuIgCoHW7vfVnpdaS3UJ9Xi0fh9MM Rqfu1zSz7K3TdQvjZ4l6YmLIoO5fKWMqpRszOGvlaqjlDI8OMWoWmxmuGu4H1WN9G6wl SWpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NRYH2aD+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n19-20020aa7c693000000b0050277665b9bsi9282240edq.407.2023.04.04.01.16.20; Tue, 04 Apr 2023 01:16:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NRYH2aD+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233769AbjDDIPi (ORCPT + 99 others); Tue, 4 Apr 2023 04:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233615AbjDDIPf (ORCPT ); Tue, 4 Apr 2023 04:15:35 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07BF8E74 for ; Tue, 4 Apr 2023 01:15:31 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id cn12so127208516edb.4 for ; Tue, 04 Apr 2023 01:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680596129; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IxmMKV3AzGJpb+DJfP0Ri3E5yjDAWlJf8T4Fjwm6+p0=; b=NRYH2aD+xdXdnuA7nNqgRSyhnn2aP9Ph2LWz6h3BZx7LmEIuwO6pBaYDb5DRjWxcfW kiGL37qqa+P8NMcCTcvkA1pEy7Ez/DM2uIg+ju1lxKAMbtVHrhmuz1+f7G9jfEMJbr2+ Kh4yWf7rKMeTXgCGa0+kzfDR5lL9JW0AwFpI7K61R085HhePmYJBaO3lM3XFD5LnWtDU 0QVq98Q1UNtIQL2IaClR7bcRxK2RjweLBmAuX/uuMvNujABRxoLlWLebGlR6G1LWaamv bFuU0aF8qilZvAq3cVH92smx61Te+KxrKTDea43Zy2kAXbJf611pd8vcbbj0yOibK+yt CykA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680596129; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IxmMKV3AzGJpb+DJfP0Ri3E5yjDAWlJf8T4Fjwm6+p0=; b=Jzu7SnxMF3wEs9e/AqCUvBHbpD2uHn9bOsvvD3rmepfiq5KuGFsrBdO11CCE5+PqS3 96qzo1qAiX+fAA46maAP3WXA9aSXaGUWlFjW4RmYhRbk66QX3OhikPQIyv/Tsul+KSd6 rzl89x+dNeX0HUkrpN3R/rgemqkNudpuVovp/KdzHqRkfbYu7ohmjAyrL0+f5VfcBzAy on8YHpeTUA68d9z4aa5C9OAPl+V9MWqt2xYgD+hYleBsVTKtEy8lugsPxZ8QpWyyAG3w bJj/I++khHbF+SdLlBNfpUFaghTloU6IbaHbfjvnodiFQOWuyqbV+UkgbyXuL3+qsi/T i3ow== X-Gm-Message-State: AAQBX9dp76AMlxRztFCKCZ3t8OAOz+y5kEsfR2kxxJw6YOg8qfSlwoqO SOdHyrcni9oHbiXhoM4eQrDzYA== X-Received: by 2002:a17:906:86d0:b0:932:c1e2:998b with SMTP id j16-20020a17090686d000b00932c1e2998bmr1319118ejy.15.1680596129470; Tue, 04 Apr 2023 01:15:29 -0700 (PDT) Received: from ?IPV6:2a02:810d:15c0:828:233a:5c18:b527:381e? ([2a02:810d:15c0:828:233a:5c18:b527:381e]) by smtp.gmail.com with ESMTPSA id b17-20020a170906491100b008e57b5e0ce9sm5557101ejq.108.2023.04.04.01.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Apr 2023 01:15:29 -0700 (PDT) Message-ID: <143754c2-9e37-4386-af92-174c0df2eb0a@linaro.org> Date: Tue, 4 Apr 2023 10:15:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v5 2/5] mfd: Add support for the Lantiq PEF2256 framer Content-Language: en-US To: Herve Codina Cc: Lee Jones , Rob Herring , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Christophe Leroy , Thomas Petazzoni References: <20230328092645.634375-1-herve.codina@bootlin.com> <20230328092645.634375-3-herve.codina@bootlin.com> <20230330160510.GB489249@google.com> <20230331094208.41ab4420@bootlin.com> <6d39e9c3-fb6a-4b2a-9889-8fe8d86716d5@linaro.org> <20230331141104.42445da9@bootlin.com> <20230331165904.4e7f46a1@bootlin.com> <20230403142822.GA8371@google.com> <20230404092036.2d1cd5d9@bootlin.com> <20230404100759.5bc9cd20@bootlin.com> From: Krzysztof Kozlowski In-Reply-To: <20230404100759.5bc9cd20@bootlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04/2023 10:07, Herve Codina wrote: >>> So, the structure I have in mind: >>> - pef2256.c (MFD) >>> implement and do the setup at probe() >>> Add the children at probe(): >>> - pef2256-pinctrl (pinctrl) added using mfd_add_devices() >>> - pef2256-codec (ASoC codec) added using devm_of_platform_populate() >>> >>> Lee, with this in mind, can the core pef2256.c be a MFD driver ? >> >> You do not use MFD here, so why do you want to keep it in MFD? If you >> disagree, please tell me where is the MFD code in your patch? > > I don't want to absolutely use MFD. > I just want to put my driver somewhere and I don't know the right location > between MFD and Misc. > > Basically, the driver needs to do (little simplified and error path removed): > > static const struct mfd_cell pef2256_devs[] = { > { .name = "lantiq-pef2256-pinctrl", }, > }; > > static int pef2256_probe(struct platform_device *pdev) > { > struct pef2256 *pef2256; > void __iomem *iomem; > int ret; > int irq; > > pef2256 = devm_kzalloc(&pdev->dev, sizeof(*pef2256), GFP_KERNEL); > if (!pef2256) > return -ENOMEM; > > pef2256->dev = &pdev->dev; > > iomem = devm_platform_ioremap_resource(pdev, 0); > > pef2256->regmap = devm_regmap_init_mmio(&pdev->dev, iomem, > &pef2256_regmap_config); > > pef2256->mclk = devm_clk_get_enabled(&pdev->dev, "mclk"); > pef2256->sclkr = devm_clk_get_enabled(&pdev->dev, "sclkr"); > pef2256->sclkx = devm_clk_get_enabled(&pdev->dev, "sclkx"); > > pef2256->reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); > if (pef2256->reset_gpio) { > gpiod_set_value_cansleep(pef2256->reset_gpio, 1); > udelay(10); > gpiod_set_value_cansleep(pef2256->reset_gpio, 0); > udelay(10); > } > > pef2556_of_parse(pef2256, np); > > irq = platform_get_irq(pdev, 0); > ret = devm_request_irq(pef2256->dev, irq, pef2256_irq_handler, 0, "pef2256", pef2256); > > platform_set_drvdata(pdev, pef2256); > > mfd_add_devices(pef2256->dev, PLATFORM_DEVID_NONE, pef2256_devs, > ARRAY_SIZE(pef2256_devs), NULL, 0, NULL); Wait, now you use MFD framework, so the driver is suitable for MFD. Before there was nothing like that in your code. Best regards, Krzysztof