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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 61E66C47094 for ; Thu, 10 Jun 2021 13:24:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FC6D613F1 for ; Thu, 10 Jun 2021 13:24:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbhFJN0D (ORCPT ); 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-Google-Smtp-Source: ABdhPJyDrsbkOZyD6kLCD4DdVUtbci1V9QMmHUOI3yS2P/4OWrBF6VIxXEMbyhpfTZNovJKfZnVfkfNGszR1JOpr7O4= 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-gpio@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