From patchwork Tue Aug 3 11:36:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 490899 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp561249jap; Tue, 3 Aug 2021 04:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGe2v8niKaH1V2MmbGeauCRnt7vtRhts9D7KyW4AqXvPaYedNWEC8mm6z08q+cMSsaqmS/ X-Received: by 2002:a02:2a88:: with SMTP id w130mr18780879jaw.60.1627990657271; Tue, 03 Aug 2021 04:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627990657; cv=none; d=google.com; s=arc-20160816; b=jl1J9ljfleYCCQnK1XhtxxE13MofyX2foehNttVF3Qq+jDSX+bJ74OAAGSUXRLQTlZ qwAAcqV1PahZ0TEZl5BTK7ebhTAxrHa+Fc/08c6Xied5W7wHzr7DIxDWtjgXmmsIjHs+ kIV2oqoniWqCvBbs7HhvTxYy5W1GsThBVt6WoDxb03PuhzK/V1oKJp4pvTkhqPC8+zuR isLxWVQjEKCQVwQET8Ma4O5rL2yJFJAwFhxdzESx06P2oieniw9bHI7gmlY5qYMM+f8U CzKHEBnHwm8FZUkll5YskLNrNdIeENqEtZ65Mc5aCmoeVYvT2pRxr49InujUGXBCaaKS vniA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lx8aY+/yDtRv3FLOutHx5ZS4iEMyIdYBOMCpO0cyw18=; b=NkRCZEuTE8AGnZBdoMCgKduM7zVP+NjgF9/+2/mwZ3jy2dU6cokQ0Se4ZcTi/Zg9v+ UGLMfY4yqShY0DrJ6Oibpkf6wZF3WGtHyYTg0ceN9yv+kxUKv3uCcbXaz+IWrXVHXVhI M/M/REd3UCa2Q2fV/OTz2vs/3Nq+H8Dkdl43hLPKI0Xx4zJXE7jRH6uhazfEuSUbnczm VR3lc15SwlX8TXxcfbVYRdzxYfhm45QDyFGnDalMV7h+x7lzz3pGHoxiWBaFycKJ++uA TSDqNolSAWtgOJ52DTt+uQOcfuOAruJST+oPCIRgY48w9CUr0blhQ/JYynq9jJM7RGO6 V8sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BUOS8Ggw; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-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 y15si15944493ill.98.2021.08.03.04.37.37; Tue, 03 Aug 2021 04:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-gpio-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=BUOS8Ggw; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-gpio-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 S235666AbhHCLhe (ORCPT + 3 others); Tue, 3 Aug 2021 07:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235842AbhHCLhW (ORCPT ); Tue, 3 Aug 2021 07:37:22 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 253E8C0613D5 for ; Tue, 3 Aug 2021 04:37:12 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id pj14-20020a17090b4f4eb029017786cf98f9so4271009pjb.2 for ; Tue, 03 Aug 2021 04:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lx8aY+/yDtRv3FLOutHx5ZS4iEMyIdYBOMCpO0cyw18=; b=BUOS8Ggwq+VCAPWWigjVP6z8eL2qBxxXXQBzAIuTNLlNZXZxPG4jPoV/9pRshmmPte gdH/a/PdZt30r1WZkEoC+6upgD9f6cwEtXdpNuhy0qY08oNZlxyYLMPfb18zMZPmljTc 3cDhZ3vYl3qbrLYPUjkmv54kKQyMdH5yBLC20skpM3bXCbOFTTgAHbWUqn8OPDGin1MB KOvd+xRYIi+k8vyURRBTnFR5+8q5NpLedWzLZx0hXEOzdeTtZJWK5Cumwh4BSnUcaVMe 7/OWuyQr0QVSOq/aLUQyLSZNCaWBAMGGzuca90NABo62tyJ0KZytiDXryJ0BAf73yI7V gtmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lx8aY+/yDtRv3FLOutHx5ZS4iEMyIdYBOMCpO0cyw18=; b=R9NbvKmdFowpaUZpi74e1sUq9IuCnOrTUDTTMmu+51z4UzceLIybxXIXrQLqf3EAdG yFPfNmoVPBSEVHJCHh2Ce9ud63/A4f+w/URdLNw5rwQ+VEh8/Puu144dgaQbN3rTJo8y POdj3UMNCjMu3jkS9qe9Vx5DpZKzak/F3K7zE223LwVNadSLGfWj4lGQ0fVk2kzli4KA ndMLF18g7V1LpVRCA7w6x2KjR8rDhLE2CNtuMkVrhTEB1wzF7z5FGNIFzIcalW7WhKms 5R4LE65N/ZtYjxqPJdM89AEzJ6iFufqPBBkcTQGDlmphA34KC9b3ZhJDSV9u0FbJE7YH ojEQ== X-Gm-Message-State: AOAM532v2MtL/1u5Od+we4s/9x/Mljm0bgV0f//qlcgO+yGbtrZD3aOF EwjLOEWFRIge2Ajnj77V9hG2Eg== X-Received: by 2002:a63:120e:: with SMTP id h14mr647881pgl.215.1627990631637; Tue, 03 Aug 2021 04:37:11 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id s36sm17710157pgk.64.2021.08.03.04.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 04:37:11 -0700 (PDT) From: Viresh Kumar To: Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , "Enrico Weigelt, metux IT consult" , Jason Wang , "Michael S. Tsirkin" , Viresh Kumar Cc: Viresh Kumar , Vincent Guittot , Jean-Philippe Brucker , Bill Mills , =?utf-8?q?Alex_Benn=C3=A9e?= , Cornelia Huck , Geert Uytterhoeven , stratos-dev@op-lists.linaro.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Marc Zyngier , linux-gpio@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH V4 0/2] gpio: Add virtio based driver Date: Tue, 3 Aug 2021 17:06:54 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hello, This adds Virtio GPIO driver based on the proposed specification [1]. The specification for basic GPIO operations is already reviewed by Linus and Arnd, while the IRQ stuff is still under discussion and not finalized. I am sharing the code, so everyone gets more clarity on how it will work eventually in Linux. I have tested this patchset with Qemu guest with help of the libgpiod utility. I have also tested basic handling of interrupts on the guest side. It works as expected. The host side virtio-backend isn't ready yet and my tests only tested the flow control between guest and host, but didn't play with real GPIO pins. That will be done once I have a working backend in place (WIP). V3->V4: - Lots of changes, as the specification changed too much. Better forget everything we have done until now :) -- Viresh [1] https://lists.oasis-open.org/archives/virtio-dev/202107/msg00232.html Viresh Kumar (2): gpio: Add virtio-gpio driver gpio: virtio: Add IRQ support MAINTAINERS | 7 + drivers/gpio/Kconfig | 10 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-virtio.c | 648 +++++++++++++++++++++++++++++++ include/uapi/linux/virtio_gpio.h | 72 ++++ 5 files changed, 738 insertions(+) create mode 100644 drivers/gpio/gpio-virtio.c create mode 100644 include/uapi/linux/virtio_gpio.h -- 2.31.1.272.g89b43f80a514