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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1293C77B78 for ; Fri, 21 Apr 2023 06:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbjDUGTj (ORCPT ); Fri, 21 Apr 2023 02:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjDUGSy (ORCPT ); Fri, 21 Apr 2023 02:18:54 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AFA8358B; Thu, 20 Apr 2023 23:18:50 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DAFE510A; Fri, 21 Apr 2023 08:18:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1682057919; bh=54AEpK2Lhks/cVE8toCu23zDhRa6jQHC/5KdhVgYezI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Va3dxkvsdQ0eQN9H8oz9zrTcH3cjJzFk73BL8dfCFTpDK8wpKkwCm9y5HG9EeGGa+ O6RL2BPT2azgOJAV6lrlpVqNTrLkByDqNa5qqzt39xVf+QgtJXSRcRvkZlXcSQWhda Fxwcf2ziNwo+tcdcDPzHc35JdJy4rzFp3JCBgIJQ= Message-ID: <9130e2da-dcd1-e6aa-ed0a-935f79727f84@ideasonboard.com> Date: Fri, 21 Apr 2023 09:18:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v10 5/8] dt-bindings: media: add TI DS90UB960 FPD-Link III Deserializer To: Wolfram Sang , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Luca Ceresoli , Andy Shevchenko , Matti Vaittinen , Laurent Pinchart , Mauro Carvalho Chehab , Peter Rosin , Liam Girdwood , Mark Brown , Sakari Ailus , Michael Tretter , Hans Verkuil , Mike Pagano , =?UTF-8?Q?Krzysztof_Ha=c5=82asa?= , Marek Vasut , Satish Nagireddy , Rob Herring , Laurent Pinchart References: <20230222132907.594690-1-tomi.valkeinen@ideasonboard.com> <20230222132907.594690-6-tomi.valkeinen@ideasonboard.com> Content-Language: en-US From: Tomi Valkeinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/04/2023 21:47, Wolfram Sang wrote: > Hi Tomi, > >> How does this sound: >> >> - If "i2c-alias-pool" is present in the DT data of the device passed to >> i2c_atr_new(), i2c_atr_new() will parse the property. i2c-atr.c will export >> functions to get a new alias and to release a previously reserved alias. The >> driver can use those functions in attach/detach_client() callbacks. In other >> words, the alias pool management wouldn't be fully automatic inside the >> i2c-atr, but it would provide helpers for the driver to do the common work. >> >> - If "i2c-alias-pool" is not present, i2c-atr.c will behave as it does now, >> and expects the driver to manage the aliases. > > So, how does a driver manage the aliases without a pool of available > addresses? I can't imagine another way right now. > > In general, your above proposal sounds good to me. With my lack of > imagination regarding a different alias handling, I could also see that > i2c-atr already provides the alias to the attach callback. But if you > teach me another way of alias handling, then I could agree that your > proposal makes sense as is. Oh, my imagination doesn't go so far to give you concrete examples. If the driver has to do runtime decisions on the pool, a fixed pool handled by the i2c-atr won't work. But why exactly would there be runtime events affecting the pool... I don't know. Maybe that doesn't matter here. We can start with the i2c-atr providing the alias to the attach callback, and if we ever need something else, the (kernel internal) API can be changed accordingly. The DT bindings should be fine in either case. Tomi