Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3988724pxv; Tue, 13 Jul 2021 08:20:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdp1RX37yTjQQ488udbZ4wLqAx0+GkzNkS0O8Vzr159WXDzGJZKEGcwiug1LeP6P9hQbAY X-Received: by 2002:a17:906:fb12:: with SMTP id lz18mr2176069ejb.324.1626189655811; Tue, 13 Jul 2021 08:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626189655; cv=none; d=google.com; s=arc-20160816; b=L+SP84qohHLovn4J/xC1lkb9A+nMwqiMtLEPusojQ7B+ePR3iKFgPeDqxQhxFx0f4A 2iyXE5gyclqU7blk1Pd7APO5bGgES/lD3Q5daFA++gZKqUSpYKCJJkFqS64jGNhh8wMm t3IPrWJOn77Wr6AwLxXwkjj1HqwVWdYcAG2IImho7bAf1JQXWaxElfRPg9N4labjF0Xh 9U0/Ncv/4k4hL0B603ZtIWSt/TxAvpZWJh4ir25AuOigwHD5JkIPNQBRU1m+kJ2/rA9m FevEorrVv/5+GK0PatE5H0qdnH4aug4GQO0uftz9TGBkYXHlOACOF8CCxIVb6dgNQsv5 dgpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xGIQduPCYxV/aV0Im0h8RYp+cXt3nip3dY+ixFjG0D4=; b=r3M96rVK5KIB25s4m/QZcninZjteOOjuoHSvpZxYETqMB/l5Vb87N8KvaSFRNsDr78 MuFK+8EWRz8CJU2AWL+Dd5Kbn66e64mulhPwYWha5Q9s1nWaMYSkGvy9HjkrmHmGwTfQ T/6DkXzIuEha1T3TIyfhbI0Aqb27uzya+JeyyzylXsJMS2IvLgtVq/klWFEeH+D5CY9U lAkOmtx+MZDxhrBdRIrD2J/OuKejuC0OGWRqEUGqOBT8rLJJRnwesmdccQ0DsAsRN98A CKhBqvhHa9QnWzdCcth6g/ObeeAcUWmWMBaZoaBl16EKWxOepYJp/J3bDSjl2JQb5B4W R1Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TcfsG1pr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si19658459ejm.62.2021.07.13.08.20.15; Tue, 13 Jul 2021 08:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TcfsG1pr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S237039AbhGMPWK (ORCPT + 99 others); Tue, 13 Jul 2021 11:22:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236842AbhGMPWK (ORCPT ); Tue, 13 Jul 2021 11:22:10 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C369C0613E9 for ; Tue, 13 Jul 2021 08:19:20 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id cu14so7030857pjb.0 for ; Tue, 13 Jul 2021 08:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xGIQduPCYxV/aV0Im0h8RYp+cXt3nip3dY+ixFjG0D4=; b=TcfsG1prt2Xidr8tuUjPWsPhlRzTO3DKhno3TFVuwtzY0fb1xG+Fc3/m8YIRlCuiVf oKVuLfYy5WNx1P00HB39kWvNz6MRdodUsCmfs3KY3Oshys5KW7VYr4LKqEqSt8g2dRLz 2k2gCvZ1SbwdjahCGjwcz2r22XKwG+TLbvbRDNAiJv9iyBZ4Z7EQLTMoeOXOWqqiefGu h8Gidj4xog9mjT8MjuLFZQ3O6aJZKjQDc3qsRiiEWlsSdhwNmUkM+vhgplVoixMCZcuj ukaXAZemTefe3j49itOLtTT7SvSi8NdSw1n61/P+wT3CrRvOw2wEe0mF1OsTi71AdzA+ u9vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xGIQduPCYxV/aV0Im0h8RYp+cXt3nip3dY+ixFjG0D4=; b=KigQP+onjEMhyM7uiLuugnlmJy8rEX6k7WA9OVH6VfzHY71+Au1r8wMDejYJxFrtzs qM1xOrRaFPnfp0BFc2msYbqP0/ocqfTMRyGcX9URQ9lPVd4uQMRjFga3jZrfEqrQ9ms0 Zl+rZbXfZ8OiiF+VTTistQoXySV2U/EXJ8v3c0Lo613MIW0rEeFJzmlLk9i7R0YfKuE4 f9bFyeZN8xJcq26R/aRgwqcN0W1tiWBm/UjIPtdhRZXwLpR95yvAmmrYERtfNmCqiAFO CPRfJAmHBnHMwps/VALLc0tEmaOtTbH626XQ4NHoo9l9yHRDUV91h4H1cpIWanwJrgVS eWeA== X-Gm-Message-State: AOAM531C8lsw5eOm45zUC47AcMS3O6M1dou72iVptDy/qsAlgCZ08FDX aIlN98WDLVa8pFjSgGkETWLwcA== X-Received: by 2002:a17:902:6b42:b029:11d:a147:bb7b with SMTP id g2-20020a1709026b42b029011da147bb7bmr4067789plt.9.1626189559780; Tue, 13 Jul 2021 08:19:19 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id n6sm14172937pgb.60.2021.07.13.08.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 08:19:19 -0700 (PDT) Date: Tue, 13 Jul 2021 20:49:17 +0530 From: Viresh Kumar To: Rob Herring Cc: Jason Wang , "Michael S. Tsirkin" , Arnd Bergmann , Jean-Philippe Brucker , Vincent Guittot , Bill Mills , Alex =?utf-8?Q?Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" Subject: Re: [PATCH 1/5] dt-bindings: virtio: mmio: Add support for device subnode Message-ID: <20210713151917.zouwfckidnjxvohn@vireshk-i7> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13-07-21, 08:43, Rob Herring wrote: > On Tue, Jul 13, 2021 at 4:50 AM Viresh Kumar wrote: > > > > Allow virtio,mmio nodes to contain device specific subnodes. Since each > > virtio,mmio node can represent a single virtio device, each virtio node > > is allowed to contain a maximum of one device specific subnode. > > Doesn't sound like we need 2 nodes here. Just add I2C devices as child > nodes. You could add a more specific compatible string, but the > protocol is discoverable, so that shouldn't be necessary. I am not sure if it will be a problem, but you can clarify it better. The parent node (virtio,mmio) is used to create a platform device, virtio-mmio, (and so assigned as its of_node) and we create the virtio-device from probe() of this virtio-mmio device. Is it going to be a problem if two devices in kernel use the same of_node ? Are there cases where we would need to get the device pointer from the of_node ? Then we will have two here. > BTW, what's the usecase for these protocols? A standard interface to > firmware controlled I2C, GPIO, etc.? Right now we are looking to control devices in the host machine from guests. That's what Linaro's project stratos is doing. There are other people who want to use this for other kind of remote control stuff, maybe from firmware. > > diff --git a/include/dt-bindings/virtio/virtio_ids.h b/include/dt-bindings/virtio/virtio_ids.h > > new file mode 120000 > > index 000000000000..6e59ba332216 > > --- /dev/null > > +++ b/include/dt-bindings/virtio/virtio_ids.h > > @@ -0,0 +1 @@ > > +../../uapi/linux/virtio_ids.h > > This will break the devicetree-rebasing tree I think. DT files > shouldn't reference kernel files. We already do this for linux-event-codes.h and so I thought it is the right way of doing it :) Else we can create a new copy, which will be a mess, or use hardcoded values. -- viresh