From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EF5AC43603 for ; Wed, 18 Dec 2019 11:21:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36CA82467B for ; Wed, 18 Dec 2019 11:21:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbfLRLVC convert rfc822-to-8bit (ORCPT ); Wed, 18 Dec 2019 06:21:02 -0500 Received: from hostingweb31-40.netsons.net ([89.40.174.40]:47269 "EHLO hostingweb31-40.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbfLRLVC (ORCPT ); Wed, 18 Dec 2019 06:21:02 -0500 Received: from [37.162.94.155] (port=27596 helo=[192.168.43.3]) by hostingweb31.netsons.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1ihXNz-00B31J-Q6; Wed, 18 Dec 2019 12:20:59 +0100 Subject: Re: [PATCH 06/10] mfd: Add core driver for AD242x A2B transceivers To: Daniel Mack , Lee Jones Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, broonie@kernel.org, lars@metafoo.de, pascal.huerst@gmail.com References: <20191209183511.3576038-1-daniel@zonque.org> <20191209183511.3576038-8-daniel@zonque.org> <20191217133952.GJ18955@dell> From: Luca Ceresoli Message-ID: Date: Wed, 18 Dec 2019 12:20:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8BIT X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca@lucaceresoli.net X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Daniel, On 17/12/19 20:24, Daniel Mack wrote: >>> +++ b/drivers/mfd/ad242x-bus.c >>> @@ -0,0 +1,42 @@ >>> +// SPDX-License-Identifier: GPL-2.0-only >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +static int ad242x_bus_i2c_probe(struct i2c_client *i2c, >>> +                const struct i2c_device_id *id) >>> +{ >>> +    dev_set_drvdata(&i2c->dev, i2c); >>> +    i2c_set_clientdata(i2c, &i2c->dev); >> >> Please explain to me what you think is happening here. >> >>> +    return 0; >>> +} >> >> What does this driver do?  Seems kinda pointless? > > As explained in the commit log, these devices expose two addresses on > the i2c bus, and each of which exists for a distinct purpose. The > primary one is used to access registers on the master node itself, the > second one is proxying traffic to remote nodes. > > Now, the question is how to support that, and the approach chosen here > is to have a dummy driver sitting on the 2nd address, and to reach out > to it via a DT phandle from the master node. I don't like that much > either, but I'm not aware of a cleaner way to bind two addresses with > one driver. If there is any, I'd be happy to change that. Have a look at i2c_new_dummy_device(), perhaps it is what you need here. -- Luca