Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp515909pxj; Thu, 10 Jun 2021 06:26:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySuXNbiXJ9Zil7xy53IrFMI/36w/vB0G+fuNKIu2aTWNSbR/R/BfOBHRHn6U55s+8/LbLm X-Received: by 2002:a17:906:7052:: with SMTP id r18mr4436952ejj.449.1623331570401; Thu, 10 Jun 2021 06:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623331570; cv=none; d=google.com; s=arc-20160816; b=kSt0Y4JZZ/4mypoMa9dvQa7Za25HkF1KXF447rhlYReC6eHzOIypBGR2GjPkw7luNA FICRM/fvZs2tVc+1jIWZcW5nyIVnNEz+FmBVqPhqG0Vvt1gGDE8yJlMQd3mbZkKTuQ1G VxetXE6eHO6MJKOYYDA7kcX4HbIHscm9/U/lI2nO7kClA3y9GZroRbZmYtjIguZb/OOV 7G3k8PDGI7U3yHKNNKxRJgOHG7TKRTFKkD6UktnkxlWCTD8Cajux6u09PBDP4qeTUrYM O6h9N2owGKigRiT1nsfRQMFgd5A7MfGB6vqERnSpeAKCO8zOAJr0OYwcxj8zTC+PU1XQ N6Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XAavKKfgECftYSUKvM3CpYKRAcpqi56Dq745w27+rbE=; b=Ogf3UcnJ4dc0JL9IeTcZlm5hVH73Z5zMvvmWiXkufRSJnLsicyJoATeobQAtoNPfEE fEGEpqYXJAek+XOGa1yholfbwUI+efmvIVBg9YuHbCPbz/7k7Bqv1Qle1PVrMzu+z+sH fXN+k3bIxm5A2XJsvsJi1XiycG1mUvYQ1TFIS0jtLyC+BNLHzK/Kl9jQM/d4ealTUhL1 VmKHt9iVL4XExU0+4jt4hxL7Asvusdl5HXomnaSXEuSYcPG//T+tMF+97w7TMXC2Tc4H N3SkFhlPVCRl2B38mXKO3Tz5QxB8oGgC84TFJbLHV+/kJOyScxZaGGty+XVKQY4eIgaC WsOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=epP9NYZQ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp6si2862630ejc.697.2021.06.10.06.25.46; Thu, 10 Jun 2021 06:26: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=@kernel.org header.s=k20201202 header.b=epP9NYZQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbhFJN0D (ORCPT + 99 others); Thu, 10 Jun 2021 09:26:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:36408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbhFJN0D (ORCPT ); Thu, 10 Jun 2021 09:26:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A44F613F1; Thu, 10 Jun 2021 13:24:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623331447; bh=Rrlo6UBorgA4yYdkeJZFkNtjOdFycP2V4Yrm2576Twk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=epP9NYZQXt89/rtsnTAtov7cnnKyjo1y/JumMdVnSnEqTTdt1fcafCGB8T6u13TNU wGneCDFZD0hniYZEfbYBiYd1jQ3C8OAXUkNDYBh10PwH9bgNbd+wFGEeDhdsMBGx+x 7xzlmquhmtqxypCAV3zG+4WgK6D0Utmoov2C0sKhBilcR9nXWG0LFfd1u7He676Um+ lfeFnmeTOua8ogeu2dCVjp0YokC7Turj8V3AaoDxW7caMBAvmljcyaA897xLrpLJXk aTO86TnHPdFRa/XP7/bTziJ+QUIUa1OHmp2tfkmmdGz2d4OPSMMBPq3Ia/Oqt1rPbF 2Oh5AStVNnlwQ== Received: by mail-wm1-f41.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso4764557wmc.1; Thu, 10 Jun 2021 06:24:07 -0700 (PDT) X-Gm-Message-State: AOAM530Q0hntIJFaFBt+ZY6Q9SVdyV/tXmfs5B3DYEaOf3rZw5QLHN+T bSTjR/0Dp5Lpa/TPy2KFhlrW3ywwOGikkxhW5nI= X-Received: by 2002:a1c:7d15:: with SMTP id y21mr14854395wmc.120.1623331445689; Thu, 10 Jun 2021 06:24:05 -0700 (PDT) MIME-Version: 1.0 References: <10442926ae8a65f716bfc23f32339a6b35e51d5a.1623326176.git.viresh.kumar@linaro.org> In-Reply-To: <10442926ae8a65f716bfc23f32339a6b35e51d5a.1623326176.git.viresh.kumar@linaro.org> From: Arnd Bergmann Date: Thu, 10 Jun 2021 15:22:10 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3 1/3] gpio: Add virtio-gpio driver To: Viresh Kumar Cc: Bartosz Golaszewski , Linus Walleij , "Enrico Weigelt, metux IT consult" , Viresh Kumar , "Michael S. Tsirkin" , Jason Wang , Vincent Guittot , Bill Mills , =?UTF-8?B?QWxleCBCZW5uw6ll?= , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 10, 2021 at 2:18 PM Viresh Kumar wrote: > > From: "Enrico Weigelt, metux IT consult" > > This patch adds a new driver for Virtio based GPIO devices. > > This allows a guest VM running Linux to access GPIO device provided by > the host. It supports all basic operations for now, except interrupts > for the GPIO lines. > > Signed-off-by: "Enrico Weigelt, metux IT consult" > Co-developed-by: Viresh Kumar > Signed-off-by: Viresh Kumar 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. Arnd