Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2625977pxj; Mon, 14 Jun 2021 03:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoGKZLBAafb+zfe+MyjbKjwxQ9xec2RDb05QCldsxCiht0d4/Rwf5gcVzLRT5/aBXXFtEa X-Received: by 2002:a05:6402:2317:: with SMTP id l23mr16305338eda.265.1623666190919; Mon, 14 Jun 2021 03:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623666190; cv=none; d=google.com; s=arc-20160816; b=BqATDs8qUSEeGMnwhRz1N+3zO3nJjk2JbNExawcjFziyN3KOLc75b+r6BQT78uSHuB 7Df3PdZNB/Mq9aEkAdfJ7o3mb3mzpbpV6RjAnNizEX02UieQdT0rqmWokCVA/c51XLcr 1HwBIvX2MNw2dBPIK7evt+mzRsSnqG5GrYSymQK9WEUpaxnFD9CygF/SBM0j+6EowgaR 616UupUN737ww7wykhBSwMRiYYeDtGf+7U2hlqmuUxu5NKbQuNX/Fnqh5P2MHFncgZQa WrdlKPoYkkGjArvxc+w33qdJF0WU9OsknbkqKiBDgMdiVJogJ2s/QrtWD0YdxdIzSlss peig== 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=YZpft7OI/68AkdpRkEG65YPdqz6N6jjlPeJBBm/DAcc=; b=euZw9cfDMmsqVl2sWRG1Tmh4L07++L/6M7U0IbUjqPiYIStU2o0r5BPfidFWN4c+Xn 7u1jTcr5KRu55GMnT7+QRPWjIyj0ZLiYSMVeD0EaluUUtjdD1UcjlAsMhXvECYhirome a3HB5AeiKr6rX6zaMW9ZA3n8Qf5HJAov1c6P/8yK3B+Q8TBlGpwcqhpb+dUjIFvIQGrZ Ta8dS/3/9HnSp5FD7LUWN5kQ53e861Ce1+JhU88B6phJS8kPkhLUcjVWmXmtYJmYH9Ir 3JOOR8G7kJeNPFyBAiCZk8lGXpqbyabuRa3bxsCIqUFMkmcyMLOd3lths94U4Ixj00e9 BG+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZEy9JljT; 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 by13si10609156ejc.433.2021.06.14.03.22.48; Mon, 14 Jun 2021 03:23:10 -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=ZEy9JljT; 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 S232823AbhFNKXa (ORCPT + 99 others); Mon, 14 Jun 2021 06:23:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232815AbhFNKX2 (ORCPT ); Mon, 14 Jun 2021 06:23:28 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94042C061574 for ; Mon, 14 Jun 2021 03:21:22 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id g22so3162160pgk.1 for ; Mon, 14 Jun 2021 03:21:22 -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=YZpft7OI/68AkdpRkEG65YPdqz6N6jjlPeJBBm/DAcc=; b=ZEy9JljT0S7v4JKqlZp2tbrvTcXn7OssJFRLOCaLdsngU1E0T6hHlKfSOiLofzz+Qd CYD89wjmQkJ5qg24VB+qPG1CnGLkXuNVaRjZBqMFxJaq/qlIrixiP8M7mzSgo4aunXgX uaYZReiLfSn/RF8T5pFp5dg577Aj4ePvKGNXgtLNhY8SJF2CSwV8F4wLY1rH66F7Bf8V aMW6O23psUcC5KK3Z4bqR0a2fUmCTqtHdn1hopGeMV45XRZRBqg8ZEsYR0Ri60IiODOv Y9QGP+Tgn3YheWVxFMqjQdkb8ga4uJ1eUqNycNFbG5579Ztpkw2Po4hruC9fiShU+8nY 6Ygw== 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=YZpft7OI/68AkdpRkEG65YPdqz6N6jjlPeJBBm/DAcc=; b=t5syWGfTddvY16n+F1J6Yw/UyXf25JsNsgLl9kGx1y9aVgkiSv0HzU8GtGVdZDTsvM 9sy5CKQmsUvTcfoEYsT/wynwTtS40BdYOLaD2SVK6ZX4fVturEvPyBZMk62ttUQsVb7H 31pu3UwgMUieeYdFdxLfRxYTZu/7h8Fu5A6vnWVe1Trbyw7JIcZaMdnk60lWX+WQ0Ymj YxhBpB7KLbX5vISqv+FNkFRQd4bFvLYl1caaC4aXoo2V1JlHxhqxO+Oeg3+Q0lTE9a1G OZHEjwH8yT0WtBL1dgsMOVYT/wI9SpOJXQyfllg4Brcik52axgKXguLmDehyZywfVPft JBkw== X-Gm-Message-State: AOAM532gzTnuzsI/1eeMvK4heitjBXwmjwnHHbVMbXZVKvGrcJOiDNXg +jFKbg7rIRKfH50D8iwAvldX3w== X-Received: by 2002:a65:42c3:: with SMTP id l3mr16224536pgp.259.1623666082072; Mon, 14 Jun 2021 03:21:22 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id k25sm12058962pfa.213.2021.06.14.03.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 03:21:21 -0700 (PDT) Date: Mon, 14 Jun 2021 15:51:19 +0530 From: Viresh Kumar To: Arnd Bergmann Cc: Bartosz Golaszewski , Linus Walleij , "Enrico Weigelt, metux IT consult" , Viresh Kumar , "Michael S. Tsirkin" , Jason Wang , Vincent Guittot , Bill Mills , Alex =?utf-8?Q?Benn=C3=A9e?= , Stratos Mailing List , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Stefan Hajnoczi , "Stefano Garzarella --cc virtualization @ lists . linux-foundation . org" , virtualization@lists.linux-foundation.org Subject: Re: [PATCH V3 1/3] gpio: Add virtio-gpio driver Message-ID: <20210614102119.qifm5sj7fpg54iqo@vireshk-i7> References: <10442926ae8a65f716bfc23f32339a6b35e51d5a.1623326176.git.viresh.kumar@linaro.org> 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 10-06-21, 15:22, Arnd Bergmann wrote: > Can you give an example of how this would be hooked up to other drivers > using those gpios. Can you give an example of how using the "gpio-keys" or > "gpio-leds" drivers in combination with virtio-gpio looks like in the DT? > > Would qemu simply add the required DT properties to the device node that > corresponds to the virtio device in this case? > > From what I can tell, both the mmio and pci variants of virtio can have their > dev->of_node populated, but I don't see the logic in register_virtio_device() > that looks up the of_node of the virtio_device that the of_gpio code then > tries to refer to. To be honest, I haven't tried this yet and I was expecting it to be already taken care of. I was relying on the DTB automatically generated by Qemu to get the driver probed and didn't have a look at it as well. I now understand that it won't be that straight forward. The same must be true for adding an i2c device to an i2c bus over virtio (The way I tested that earlier was by using the sysfs file to add a device to a bus). This may be something lacking generally for virtio-pci thing, not sure though. -- viresh