From patchwork Tue Jul 13 10:50:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 474627 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3836972jao; Tue, 13 Jul 2021 03:50:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmiCi0FVvIsRpNamC6N7dTPQ/AXtWY+uVvOzYVAn17bAL34dgKsKeXTEPOZ0e4FCze586f X-Received: by 2002:a17:907:7709:: with SMTP id kw9mr4934276ejc.68.1626173451883; Tue, 13 Jul 2021 03:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626173451; cv=none; d=google.com; s=arc-20160816; b=LfSA89RXCwXycu9o0Vs94F4EVEhjNJ9UtGVRjP6mgoirQ3QHnNtGXqCdmugSkz5Dok Ip14vACMU/QPWxa6+Ze/KiVbpKDU5mXEnkdcgDPfiXpAAsBH4sVrmlmVvEalkhgZGBPJ kP3DLRwXlu6XLbGR42UM9hlyK6Tbj2f1+FtIRLwBDsQycvpSQWcrOAq0n+JlBY5V3+Rn 0EKjZz5zmK2WjhGpSn8uTrU2e2aavbLVegSOnEAQjT6nU7E4aB268ONai9YngS/vexTv G1JfJZHmVjsaVcy1An/d2bIDQeLQ00RH9czLwpmXELJmxVqwN4jE5INryOTKr+dJp1sl 2ffQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VovCFljnf1vTBUJ7EdFbbYpvvdVza8LaWe5CrOJSY7g=; b=dv1tf5ctaCdKo40Bp0MjPbpBurVtXql+U1voDN+aX8r5W3F/fwDBRbGP+vYqNYK7zU ygDZOnL6UpUndCQELkuH7JFiTjxZsuwy92c+cZ12d6MqREPfpbqbxm2z8M54bx+zhaZi BKPctCCsbRJhe/9RIUqiad36sHrx/2gOQ8qA3e21//EZYJsrOnjxZXsxuI8ENx1T+04c WjCWvfK8VKzBjE/nbkIqbfcco8+kzDxVV3ui7RwuHlMnNz0YbVbTiALiYLrN3eLXcp6g BZ+tkmeCNlGLTcgGe/DS/x40yfrhaA31Z9mqp9vOz9o+Y+TE82cGE7qZUH9Qgp5Md3x4 1rFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=POuW7HR8; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 ga12si20801870ejc.247.2021.07.13.03.50.51; Tue, 13 Jul 2021 03:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=POuW7HR8; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S235697AbhGMKxk (ORCPT + 7 others); Tue, 13 Jul 2021 06:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235496AbhGMKxj (ORCPT ); Tue, 13 Jul 2021 06:53:39 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 518E1C0613E9 for ; Tue, 13 Jul 2021 03:50:50 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso1831852pjp.5 for ; Tue, 13 Jul 2021 03:50:50 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=VovCFljnf1vTBUJ7EdFbbYpvvdVza8LaWe5CrOJSY7g=; b=POuW7HR8+JRq0XcNb2gwX87+Cdjg734uF/GDz9PpL8tv7tfi4R7JI4s3lyzjd2HTky etuO4Xl+zc7ofYqTlHgCoeEuDnEJAUvuD59GNUTQJofDM4e9n8MVO2Udb5UWRTw9AQWE QgYDoVAvfyhm1eK6OHAJen6/cxYL6xox1/+zVUMCQQ4rD83iGXwWdj5AMUl6DhxxS3b5 8TVnfRubFFifGeIY6CRsrgy4lJeF25GP00i+yiscR/aM4wYTi2rRgT3SzaGeuxkZ2aBY HGFkrDpEonK2gGrgOrQIJvCVmsz2HQbt5ijEbpE3Z0DmCaTBIxFT788zMADnVE8F4MQM Gk5g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=VovCFljnf1vTBUJ7EdFbbYpvvdVza8LaWe5CrOJSY7g=; b=euu+E2/zLAwMfB44YazCC4OKYpeNQ5HEwWV3RSca6Zv7o45mXp6SOay/OWvjRTuVDX IUUww6yx4EThSfHHmr8+PsC0Zcv42XxSlg0PqcM3BVPT8RmXqc3C4WTFTIKT6TXKHBxC i/h6+MVm8pjkZ+XgwU+0aZ+a4OFoacWRYgi1eVuXtw03fHa0ovvVpK1xy36ee6ImE7QJ eCEjXQd0/LZ8EyRWi5Vg4VD1fKMYSi62M5rWLqqlCXGLC693yqE8JwNufmg9lCL6OJLk aFmbbGvuj7G3tnT3ahoctNWzrYRWWcvTOJs2GI1VYx+f1u4845wdjeKpuKr/DdvHpH4q BeBA== X-Gm-Message-State: AOAM532Ly1zIy3jLdSHRuQyjaAPW4s4WHSQGy+E0lNq5RcZhzEAed3ye 7LNfhQPBhYI89yw5B/CVhtaUuA== X-Received: by 2002:a17:903:184:b029:12b:3b0f:a7a3 with SMTP id z4-20020a1709030184b029012b3b0fa7a3mr472500plg.24.1626173449854; Tue, 13 Jul 2021 03:50:49 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id h11sm5086664pjv.57.2021.07.13.03.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 03:50:49 -0700 (PDT) From: Viresh Kumar To: Jason Wang , "Michael S. Tsirkin" , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker Cc: Viresh Kumar , Vincent Guittot , Bill Mills , =?utf-8?q?Alex_Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 1/5] dt-bindings: virtio: mmio: Add support for device subnode Date: Tue, 13 Jul 2021 16:20:30 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. The device subnode must have the "reg" property, and its value must match the virtio device ID used by the virtio mmio node. A phandle to this device subnode can then be used by the users of the virtio device. Also add a symbolic link to uapi/linux/virtio_ids.h in order to use the definitions here. Signed-off-by: Viresh Kumar --- .../devicetree/bindings/virtio/mmio.yaml | 41 +++++++++++++++++++ include/dt-bindings/virtio/virtio_ids.h | 1 + 2 files changed, 42 insertions(+) create mode 120000 include/dt-bindings/virtio/virtio_ids.h -- 2.31.1.272.g89b43f80a514 diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml index d46597028cf1..e5f9fe6ecb5e 100644 --- a/Documentation/devicetree/bindings/virtio/mmio.yaml +++ b/Documentation/devicetree/bindings/virtio/mmio.yaml @@ -31,6 +31,31 @@ title: virtio memory mapped devices description: Required for devices making accesses thru an IOMMU. maxItems: 1 + "#address-cells": + const: 1 + description: + The cell is the device ID if a device subnode is used. + + "#size-cells": + const: 0 + +patternProperties: + '^[a-z0-9]+-virtio@[0-9]+$': + type: object + description: | + Exactly one node describing the virtio device. The name of the node isn't + significant but its phandle can be used to by an user of the virtio + device. + + properties: + reg: + description: + Must contain the Virtio ID of the device. + $ref: /schemas/types.yaml#/definitions/uint32 + + required: + - reg + required: - compatible - reg @@ -57,4 +82,20 @@ additionalProperties: false #iommu-cells = <1>; }; + - | + #include + + virtio@3200 { + compatible = "virtio,mmio"; + reg = <0x3200 0x100>; + interrupts = <43>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c-virtio@0 { + reg = ; + }; + }; + ... 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 \ No newline at end of file From patchwork Tue Jul 13 10:50:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 474628 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3837034jao; Tue, 13 Jul 2021 03:50:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySUp/Wd5whE/eU1HLssT8DDkKW35HiJ7WUGr4yYdKW2KOrGInPB/HE/akKkywbq29arTkr X-Received: by 2002:a17:907:ab0:: with SMTP id bz16mr4846141ejc.33.1626173457067; Tue, 13 Jul 2021 03:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626173457; cv=none; d=google.com; s=arc-20160816; b=QKib+4/XD48PR+ZuQt+tHGOnH/bMxs+dzWa9kLBImOxgMBOe8TJU0HPIHPouihtK/3 MZvPau6FYpa7OnKEOEnQqvyDeP4g5hHEdafyWGXl6V1HofKsHJ4pmuIERk/Oc7u4rY+N CX1Ku4UYrNErVoderQSgt/xjxOkQujY7RIhpiL5g5DUd+bWdppUOVGsbz/pyhZSbZol1 xGBNBvlh3rRSodHxOjLA8sFDFeaMc+lhD8Sr2S3ZUlR55lmrjA3FHHAiD1wkfdFXnJFE m+LYX5WLRmOOMpFnOIcNeF/MpSu4OzQe4EzqQC0VNoVG1LZ3f4t8Xp3MHNwB2UegWP8J aYyA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=986/a+XL1T//36W39++oB7kOlKnW5eYSo8veeEHej88=; b=b57CmGg0DAk9le+z1+ECW0q7InxyD7tIcssALOcDD9SDSJC2blqU7qV63Ayosgj9lv bSqlG/uhNsnMJQkWUYr4xl07c3wtnP1UQJf/dr9H18ohauEZf9XOIvegH33djdVoN51O kryLA5pYOrj33pMeVIha6Rrh8DpMrF7m1i/MrjTe4qsTuY+BdHYI65NwQJusuu5iS+WP C//K1sYnePgpfKPy/JzBOCESn6TT+iigb3c/2fEogBxdJHPnpjPEm5ajqAm5m96xUXw6 HBKZpEbKbiHeXHoo+PsDEEGsKA0NAxnUIv++l3WtdG/HdJhYnkiXAOQfQed/xc6dM+Jk 8+Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="A3Q/umcF"; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 ga12si20801870ejc.247.2021.07.13.03.50.56; Tue, 13 Jul 2021 03:50:57 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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="A3Q/umcF"; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S235772AbhGMKxp (ORCPT + 7 others); Tue, 13 Jul 2021 06:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235717AbhGMKxn (ORCPT ); Tue, 13 Jul 2021 06:53:43 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31FAFC0613DD for ; Tue, 13 Jul 2021 03:50:53 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso1838178pjp.2 for ; Tue, 13 Jul 2021 03:50:53 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=986/a+XL1T//36W39++oB7kOlKnW5eYSo8veeEHej88=; b=A3Q/umcFWAyQTFsjWu0zZq7yNfzjuO2F03oZsK9+N4gsF+Yto7uv9o93Cw5O4pU30l pmnq3CcUhEL/8tHaQIa+H/J2XMafGoTkXXFgigVY7VlwFGYDdhNmVsHwifGLRFlY6aBF MhZjtulyDf+CNgTgvShltXI9F0SdCXh8U3XJrTebKTTnwD7KJkBiCo6+0X64QFfMWTCP mpx5FAYJl1zlDjBE91cO4IM6oEEZBzb7Oh9yI6PC8BwncgDUhYF+CuBM/obQfTg5AqOc 4JVUPbUiBB3xNewdVUjwYvLePcJIV3R0zNGOZDUrLFAn56bpGPhYm7ZQgbg+7xnbUY6v 9gcQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=986/a+XL1T//36W39++oB7kOlKnW5eYSo8veeEHej88=; b=d6pP2ROJ29OIjHEqtWloqc8BsTgY3o5rF/DKKfMT5d2aHnG0TnVQNYphVRdQtfoK2o LJr7Vf44uBtsMmGTH9egikKHrNIk/Z4EJ7neb/jG3RfK/5WHKEvEtTpjpgQdHJPaX3nD +CPdVoZhJZLOIJuRROyGvT49Rt1rqSprlefeFlAvQewlY7zOBktYmOHz/TzBL0Z2L3sX cIM0WFrcf3r5MlSDljGOcsOjB16GB2TRIJeVsbgwWthz6ZroDvQfPat1TyATAm0ez2tk ZUW6pKnx/U51vV6QcWnqv7KEpqKR2YtFiVe+gf4iIpsRXG5H5RTWl2Vr0nuBNexOtk96 4P+Q== X-Gm-Message-State: AOAM532vrc/PpiPF2xnzrjg+TRSjYZd3ybQ8fOX7wlxfTvvBddtINTMT lDwf99ZExn1MdVfKoZrqamjV0g== X-Received: by 2002:a17:90a:1549:: with SMTP id y9mr3808382pja.211.1626173452771; Tue, 13 Jul 2021 03:50:52 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id y15sm8993842pfn.63.2021.07.13.03.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 03:50:52 -0700 (PDT) From: Viresh Kumar To: Jason Wang , "Michael S. Tsirkin" , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker Cc: Viresh Kumar , Vincent Guittot , Bill Mills , =?utf-8?q?Alex_Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 2/5] virtio_mmio: Bind virtio device to device-tree node Date: Tue, 13 Jul 2021 16:20:31 +0530 Message-Id: <26ba6941fa01eee88c99ecdd611d235c22bd6e3c.1626173013.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Bind the virtio device with its device protocol's sub-node. This will help users of the virtio device to mention their dependencies on the device in the DT file itself. Like GPIO pin users can use the phandle of the device node, or the node may contain more subnodes to add i2c or spi eeproms and other users. Signed-off-by: Viresh Kumar --- drivers/virtio/virtio_mmio.c | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 56128b9c46eb..ae40546a66a3 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c @@ -551,11 +551,51 @@ static void virtio_mmio_release_dev(struct device *_d) struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); struct platform_device *pdev = vm_dev->pdev; + of_node_put(vdev->dev.of_node); devm_kfree(&pdev->dev, vm_dev); } /* Platform device */ +static int virtio_mmio_of_init(struct virtio_device *vdev) +{ + struct device_node *np, *pnode = vdev->dev.parent->of_node; + int ret, count; + u32 reg; + + if (!pnode) + return 0; + + count = of_get_available_child_count(pnode); + if (!count) + return 0; + + /* There can be only 1 child node */ + if (WARN_ON(count > 1)) + return -EINVAL; + + np = of_get_next_available_child(pnode, NULL); + if (WARN_ON(!np)) + return -ENODEV; + + ret = of_property_read_u32(np, "reg", ®); + if (ret < 0) + goto out; + + /* The reg field should match the device id */ + if (WARN_ON(reg != vdev->id.device)) { + ret = -EINVAL; + goto out; + } + + vdev->dev.of_node = np; + return 0; + +out: + of_node_put(np); + return ret; +} + static int virtio_mmio_probe(struct platform_device *pdev) { struct virtio_mmio_device *vm_dev; @@ -621,6 +661,10 @@ static int virtio_mmio_probe(struct platform_device *pdev) if (rc) dev_warn(&pdev->dev, "Failed to enable 64-bit or 32-bit DMA. Trying to continue, but this might not work.\n"); + rc = virtio_mmio_of_init(&vm_dev->vdev); + if (rc) + return rc; + platform_set_drvdata(pdev, vm_dev); rc = register_virtio_device(&vm_dev->vdev); From patchwork Tue Jul 13 10:50:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 474629 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3837049jao; Tue, 13 Jul 2021 03:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbyUGZgVw+oWLMkSKsqZwgQapQFuuD+OwX9ZCz+5uZhb14jI0OCbT7kxyk9ZRkQh+v1FhO X-Received: by 2002:a17:906:1704:: with SMTP id c4mr4883768eje.182.1626173458011; Tue, 13 Jul 2021 03:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626173458; cv=none; d=google.com; s=arc-20160816; b=C9RwLI/xaDvnWsiPf8yO7vNXOr9aAGc2c0ad/oUL9LfPtfNrk2RMJeYK1HjSi1TV/V PBZ43nlDQcJdlBOJqGHA3NiRcQmyi6Y3LYQ2ImB4ZKshiCJmUO8djDojEaDdvUtLgXRs T0kHUkxS0GArqHRW0o0TVZxpIqShyPAEJCocWRKEsacK3DmRb+srToli8W2ef2kSkgqn Yw6pQzjS3riPClmMPguvLB3N8uar+kVLMDEGyhbPEzXlP+P0L+9+2hoSZu9ky0jh8AHL kSyV8/U4C6Dw+BvZS3ENJB8mRQZFvMKW+yyb9d1zAOs5YHPdsKuZ2g9oGJxCwryFrxoI 3m8g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EnYeCy+chnb7U/9RWgipxfZ5cRd0rbKv0JJVnp8Co5Y=; b=0/8fivRIlZY0hcDtWGKMsEXv7MV9D62wCkUKoPahf31qRPYMvFH7NR+f9DlI/j20xg iUlAIzgddmCWaH8kjmX9TL4ACxd9FnvrmnPttnOKFP2I86De7SkRZf2/P1owFCPW6Xm6 HW3UpJ7l6KOmzyRLhLWkJvDGfDn+hlIENdbJ9km2opKD3r09Yq6odAF6U/5qE5eX4m5E GRpDl67WXeHBR4yBtTc1V8R4dAriYN3d5BoyoclRVC8t9eb9V3CaOTBLOZjb+SVvY4ay cPpX0cBDMBoB7mnAqndrJ4r1gyKodNEjool8NVgfWPo+MhPGLQG8KF3JHlaydMFcasLg v0Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uQicnpu8; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 ga12si20801870ejc.247.2021.07.13.03.50.57; Tue, 13 Jul 2021 03:50:57 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=uQicnpu8; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S235765AbhGMKxq (ORCPT + 7 others); Tue, 13 Jul 2021 06:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235730AbhGMKxp (ORCPT ); Tue, 13 Jul 2021 06:53:45 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13B4C0613EF for ; Tue, 13 Jul 2021 03:50:55 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id m83so11531030pfd.0 for ; Tue, 13 Jul 2021 03:50:55 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=EnYeCy+chnb7U/9RWgipxfZ5cRd0rbKv0JJVnp8Co5Y=; b=uQicnpu80puHC1nV5JPxVpt/PFOS7yVYWyaQTg4Uwxzc4iiZk+ry2Cx73baKppSbd4 S1Wse1LRZHJlQ16GIA6bUJUSbYpSOzn2g3Kbqyhvhs1B1XsdFEjn64Q5XJh6cambq301 z1PnI1cya47F89QVVf3lMh1zNiIO0ljJ4R03zP+/pRZ3uv3l+vQPtfdOSVgtAnwqNNzG 7xluKvxfcU8k8H3ZRG8bRYBUyCRyVGEpQCp5uN8SS9iCJow6P+QZuIyXWtpIQu9UwS5C ZbspVAbJIVcxm3Bpk4dxPbudsz5ZfItF2VMrj72D+yM6NRLpOA4daWGQUW1YMimZPZEh uzCg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=EnYeCy+chnb7U/9RWgipxfZ5cRd0rbKv0JJVnp8Co5Y=; b=K30+/ErHHyIRDs+t5BTY0Y0l8/TH8CbpuwfQ8aOAOEATreKGw23dlmzhTVaUgVnhTT esjHGJAdTlbfUrNDkIU2uchFBStPu9CX7YARBfiGnepeoi8dOvN+xNWPZ8y15s8c6g4q m5DSMTZj38caaqIJpG8B+YdKzSl+BCuGlhOMFW5ywj8b3aF23niUW9RMAW65duU3Olzc yabepXZreP12m4nIvrwYDpTT0wXUB1Ah2ZYI07ORuJBKrV/wt4uY1cooPCNYT/d0CWil APPG0nLMSsuwSee6cIN+J1fHy0tihr1rt6KwBoaafaxhywLtAHIHnw6ARLog+tamihFl SRGQ== X-Gm-Message-State: AOAM533C98PCcoGDwfCTRYe9edgJzqX5FDOndXqKuB/K+r1GD0VnA1Nd SvGvlDdjlfpe1aShi7RuvI9tZQ== X-Received: by 2002:a05:6a00:a1e:b029:2e2:89d8:5c87 with SMTP id p30-20020a056a000a1eb02902e289d85c87mr4096815pfh.73.1626173455525; Tue, 13 Jul 2021 03:50:55 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id gb10sm2411155pjb.43.2021.07.13.03.50.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 03:50:55 -0700 (PDT) From: Viresh Kumar To: Jason Wang , "Michael S. Tsirkin" , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker , Viresh Kumar Cc: Vincent Guittot , Bill Mills , =?utf-8?q?Alex_Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Wolfram Sang , linux-i2c@vger.kernel.org Subject: [PATCH 3/5] dt-bindings: i2c: Add bindings for i2c-virtio Date: Tue, 13 Jul 2021 16:20:32 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org i2c-virtio represents a virtio I2C device and this patch adds binding for the same. The i2c-virtio subnode can be part of a virtio,mmio node and is based on its binding. Cc: Wolfram Sang Signed-off-by: Viresh Kumar --- .../devicetree/bindings/i2c/i2c-virtio.yaml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-virtio.yaml -- 2.31.1.272.g89b43f80a514 diff --git a/Documentation/devicetree/bindings/i2c/i2c-virtio.yaml b/Documentation/devicetree/bindings/i2c/i2c-virtio.yaml new file mode 100644 index 000000000000..6b6538f9a3d8 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-virtio.yaml @@ -0,0 +1,59 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/i2c-virtio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Virtio memory mapped I2C Adapter + +maintainers: + - Viresh Kumar + +description: + Virtio I2C device, see /schemas/virtio/mmio.yaml for more details. + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml# + +properties: + $nodename: + pattern: '^i2c-virtio@[0-9]+$' + + reg: + description: + The cell is the device ID of the I2C device (VIRTIO_ID_I2C_ADAPTER) as per + dt-bindings/virtio/virtio_ids.h. + const: 34 + $ref: /schemas/virtio/mmio.yaml#/properties/reg + +required: + - reg + +unevaluatedProperties: false + +examples: + - | + #include + + virtio@3000 { + compatible = "virtio,mmio"; + reg = <0x3000 0x100>; + interrupts = <41>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c-virtio@0 { + reg = ; + + #address-cells = <1>; + #size-cells = <0>; + + light-sensor@1c { + compatible = "dynaimage,al3320a"; + reg = <0x20>; + }; + }; + }; + +... From patchwork Tue Jul 13 10:50:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 474630 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3837139jao; Tue, 13 Jul 2021 03:51:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZRZYlDlq1aiHKC2ZCx4Uz/SQrNpqvYGs8zzD3trhfeI+xyUyhFuLQYlX/zMeNCO6mbjkM X-Received: by 2002:a92:c805:: with SMTP id v5mr2250024iln.293.1626173464362; Tue, 13 Jul 2021 03:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626173464; cv=none; d=google.com; s=arc-20160816; b=w4qDoWFvzyn3/5avDBw4Wcqa2zpqNELW8FOjKhbuxYW1y4sLpXtFRCq9EV5wGUlyP6 nLXCGJcVdesQ7jM0Yb63bUX4H1t9hd4hcGRm45SDy+CN3+DnBGI3izzQgw/o5op0Ua/0 vRZBZ9ZBoUCBCS6dJA4l7m1pwR5kR7ujwSaBsqTY4z0Ln9Xrnb722OdaDj6GdNQFJq9k AIsD0ZtfRGRWEuCLCyLXfy2+NXr8Ncs68mziWThhEXSz0W2WnEflRYFGyiz9q9BuqG89 kVpKL9gr1h7z1mWDgjq5ohbNXd9bFX0WutHAlJNPQDYA+7QhGOa4j0VjaBj6s+rhd0qO nTXQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jpLLVifshAbN8p9woBgv2ZTKXWPkKhiksBb+TTgeAU0=; b=B0hs9p/AMsu+wX1Mb8eUr098EDkn7dcOEhuLIu1mLf7/fizXjyyGLcx9lnwyzngWwF wcZKp0KKd/LvrU3QMwYk4ubq9UdeSd8ID2gtcytEsqMOtu1NJEqB3WWcTd7WDn9N2m7l utqJyD62Dxb1Zf6uh4E874XrdB2x+2feN25NqUoL6eNaoVTk+6XV1qYv428ivMtmytJR dKEFCNh0+V7doYNN3yrpE31BwRSfltV5KuqGnz1iQ46bMweZiT04FagNTMKnwqv/h8Q1 2dfUB3sbzHvvKPRxBFWQArJbi73AHQKnBQ0rtyga9AW5ee4GmGf7CYOFzPfGs/THnM5i hatQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xPiyCCSN; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 g3si13232300ile.55.2021.07.13.03.51.04; Tue, 13 Jul 2021 03:51:04 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=xPiyCCSN; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S235716AbhGMKxw (ORCPT + 7 others); Tue, 13 Jul 2021 06:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235813AbhGMKxs (ORCPT ); Tue, 13 Jul 2021 06:53:48 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3244C0613EF for ; Tue, 13 Jul 2021 03:50:58 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id me13-20020a17090b17cdb0290173bac8b9c9so1162418pjb.3 for ; Tue, 13 Jul 2021 03:50:58 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=jpLLVifshAbN8p9woBgv2ZTKXWPkKhiksBb+TTgeAU0=; b=xPiyCCSNVpUMFrtC2LlEfZacKYLM5pphD5lCNG/nuXs3LaUM5dOdfAlFOW8nZwkqhu KkEF7hs6FWetfVpeyk/kj3vIOQp4c6kMkbj6KB3alHAs2XmY8I3JJLGZsAfy8sG9X+dY MlDtHTK4uyqX6888rCNx/o5Z7cT6DVqqrP4t3QalqFpSyc4jzUya9kWF44FBWSom0UvP k2s8/NkxjOW2mRNP0ZkIt0ONSWCgLwQWrPScrazAgHeRnZd+2gznoA9yhDKk8YDfK2w+ yGYMNjQG8zE+vM4M3R7yjJNtvjpVzhwmWwlT3+wIeF14JFd7vkYNAXazbJKODKH7zP7X H+dQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jpLLVifshAbN8p9woBgv2ZTKXWPkKhiksBb+TTgeAU0=; b=oFw8If3XXFs92CyPopo5cN8YwOCAd46MD1/+x2gBUYg73C13zebNHYQVQ6kFJwL1Rp xnALwBmK5Eq/4dJQe/p0kBZTlJ3EWDX1pSbEtgzyQiULIenrPwdsjp1MPnlcF3Bms5LT Y1xILQ8QGn7MEvz3OaJu4jkcQjdnO1tae5vGcKMj4aeCPNo8jtbqhLb6jOyu4vOzaZEF 0IK9HJKZsyMCBoz7D1/cHPq1ALa0sKSTq4pnufCdEXK1Ww+5bzpJALTHWKkoehQahmoQ /LhvTNF6572UgeJI2ajl4qq3t5+I713VCeF7EEHoDc45ZkyLgx9OYJHqTDexqKNR5o5G jETQ== X-Gm-Message-State: AOAM532in1AngOYcaCm5A3mbuOtZ1ervAHqLga/jtOhQKwTxFNHS6sma h2O+qIvta3HUYV5/dD1q/9rS3Q== X-Received: by 2002:a17:902:9b87:b029:11e:7c15:a597 with SMTP id y7-20020a1709029b87b029011e7c15a597mr3091660plp.6.1626173458228; Tue, 13 Jul 2021 03:50:58 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id m13sm18415675pfc.119.2021.07.13.03.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 03:50:57 -0700 (PDT) From: Viresh Kumar To: Jason Wang , "Michael S. Tsirkin" , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker Cc: Viresh Kumar , Vincent Guittot , Bill Mills , =?utf-8?q?Alex_Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Wolfram Sang , linux-i2c@vger.kernel.org Subject: [PATCH 4/5] i2c: virtio: Update i2c-adapter's of_node Date: Tue, 13 Jul 2021 16:20:33 +0530 Message-Id: <5465df68b2e18d510fa47e691907287fe655fe8b.1626173013.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Set of_node of the adapter from the virtio device to enable automatic parsing the of the I2C devices present in DT. Cc: Wolfram Sang Signed-off-by: Viresh Kumar --- Depends on: https://lore.kernel.org/linux-i2c/984ebecaf697058eb73389ed14ead9dd6d38fb53.1625796246.git.jie.deng@intel.com/ --- drivers/i2c/busses/i2c-virtio.c | 1 + 1 file changed, 1 insertion(+) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c index 0139cdc33cae..cb8cfae2748f 100644 --- a/drivers/i2c/busses/i2c-virtio.c +++ b/drivers/i2c/busses/i2c-virtio.c @@ -223,6 +223,7 @@ static int virtio_i2c_probe(struct virtio_device *vdev) "i2c_virtio at virtio bus %d", vdev->index); vi->adap.algo = &virtio_algorithm; vi->adap.dev.parent = &vdev->dev; + vi->adap.dev.of_node = vdev->dev.of_node; i2c_set_adapdata(&vi->adap, vi); /* From patchwork Tue Jul 13 10:50:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 474631 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3837208jao; Tue, 13 Jul 2021 03:51:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy42uwuoEo73zKLgVh9RmkkKlcyLuSw2Thi6kWvKt4hNY1DxsqOaehOYOwww++x4mG3cyHD X-Received: by 2002:a02:9648:: with SMTP id c66mr3529161jai.73.1626173469944; Tue, 13 Jul 2021 03:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626173469; cv=none; d=google.com; s=arc-20160816; b=F50kCjX7X5LL8pYFiodriFlDOOt/qjYAXBFZJ3xYh7GFKXnQohXb4ZgscEcjR7oDYT QCIYZ2qv7jGyeCWIZ/4NLQt73UFikVfkGCFbPWKdOfkU4Ehc8CakVBNvfdRcCmqrZ2gH K3QoubUeqFdnXzQq5cKD6DC3Sl98CkhljV1d3P5RWeIcwOMG1e22DB5U35V9P2ShBJfZ NMo8v9kFHlk2wgxvKcL1ld3PuiMUxt+vNlScuYOV9hX+J5AB4qn63qZB5FcaKBG65DWF OQeTkpbOW02w9PYr+AL7pS1sZteI40CE8bPkP+ocsqcCDPbK/3VgjcbWffzQ46yMezBi lQZg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xzH7sesTaozGr2aBJCA9PbVMd+/TXsUDxdM6aSXl45Y=; b=OSrDnHhQXyj9D6XTURoRtBKGJBGb/kOdz/2HwHeN4uNhNG5I3wtE/SRG/yvDP5GCzB 7lK4iq2V261Y8qZtzLjziCzGGAQGTL5GZMrueQtA+sVGzDXtB+uyBFN2pNmDVzDmzkzx 612vxBqVzv8GShrcIjaU9n4V0qN3KaxsOE0Nx87W3IvaRtHlie72n/2KORUgcxv90C1U 8u/D8i5bUP+5CidwgNGDKFViqCPNR5Xade6MSP7hylRetK00sCoBoYhEUOu+1HvfrDaA Y82FyJ1nNMxJEV+MmfQqgj2YC/CgFdv8Ar/MQVUHP+i9YlRGQerdct/kZnd5u8P5lHAT A05A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UfdEgV6e; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 l15si3699673jad.101.2021.07.13.03.51.09; Tue, 13 Jul 2021 03:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=UfdEgV6e; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S235826AbhGMKxy (ORCPT + 7 others); Tue, 13 Jul 2021 06:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235843AbhGMKxw (ORCPT ); Tue, 13 Jul 2021 06:53:52 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD28C0613EE for ; Tue, 13 Jul 2021 03:51:01 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id j3so8973421plx.7 for ; Tue, 13 Jul 2021 03:51:01 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=xzH7sesTaozGr2aBJCA9PbVMd+/TXsUDxdM6aSXl45Y=; b=UfdEgV6ejBlsj8JxfNTCpyqoujkZOrd26OFYbtyNGrFFn1w8vIXL3x/tuh8kYEN7zh gMfxw3nWN67wNY+Ia620l6fmfgeo/5SjhwpvWAQldauqCMbEN1360puiqwBIkfK5Q4uZ wpSwJXVJjy3E6hA7Xjo4ciCm1nwSoklVD0YtzlI7ndrcYmCfBkYSFY80XKzfNVNVyMst nFIHVvEmojYLFlPQ2vf2P4X/xU56jTh3kY+isL6DcaxrPFjSjGwGKwIfDMUc7lh/xYoG z4d/R32YPIe0nHFMqPqcSzBaoBw9/4vKH5Sp/SESjA6uqWTeDPV9t93lEi7qZGCipQA5 YXzA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xzH7sesTaozGr2aBJCA9PbVMd+/TXsUDxdM6aSXl45Y=; b=Zoq6QGsGhiepNwq5Iuh7ZbQ7DjPe0/AK4/llN1ZhZmTyrdZdwHzKUaSVFjdg2u1/0b uU/gUI0bI+wwwEiOrralkokmynK+EkM6ncKeArdc/EFJTMIS+VxAru8PgOWgwABlYlTS tu80R5IA1rZwuB4z+acinlTRE/MMkjJksFBcS/bEE8BDcwLJkyimPpoNyiWQenWxceCQ NjiqmUXV310bSYvkZKpWfATyKkpVMgF2jtztp0EsabwFyAISoIcCJaOcOaecxRHkupZ/ 2JaDIHm4QsFq9UV1AVp0gu//mcPpmFoTNMVlA07EA/eiw41QVMcoZ1yQAduCARnr599r 3nYg== X-Gm-Message-State: AOAM530bbbQZ/PfyXPdcxYkuCxPLA9PpET6jROSCrp4ZqUQVFHrLxmwQ DTpoYXQLSgsv6WIqFyBesCrmlw== X-Received: by 2002:a17:90b:1294:: with SMTP id fw20mr18966339pjb.100.1626173460987; Tue, 13 Jul 2021 03:51:00 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id i8sm5898474pfk.18.2021.07.13.03.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 03:51:00 -0700 (PDT) From: Viresh Kumar To: Jason Wang , "Michael S. Tsirkin" , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker , Linus Walleij , Bartosz Golaszewski , Viresh Kumar Cc: Vincent Guittot , Bill Mills , =?utf-8?q?Alex_Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-gpio@vger.kernel.org Subject: [PATCH 5/5] dt-bindings: gpio: Add bindings for gpio-virtio Date: Tue, 13 Jul 2021 16:20:34 +0530 Message-Id: <268086e273df0c53e3a9a1e751304c63e50ebe12.1626173013.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org gpio-virtio represents a virtio GPIO controller and this patch adds binding for the same. The gpio-virtio subnode can be part of a virtio,mmio node and is based on its binding. Signed-off-by: Viresh Kumar --- Depends on: https://lore.kernel.org/lkml/7c716c2eb7ace5b5a560d8502af93101dbb53d24.1626170146.git.viresh.kumar@linaro.org/ --- .../devicetree/bindings/gpio/gpio-virtio.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-virtio.yaml -- 2.31.1.272.g89b43f80a514 diff --git a/Documentation/devicetree/bindings/gpio/gpio-virtio.yaml b/Documentation/devicetree/bindings/gpio/gpio-virtio.yaml new file mode 100644 index 000000000000..c813cdfd60fd --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-virtio.yaml @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-virtio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Virtio memory mapped GPIO controller + +maintainers: + - Viresh Kumar + +description: + Virtio GPIO controller, see /schemas/virtio/mmio.yaml for more details. + +allOf: + - $ref: /schemas/gpio/gpio.yaml# + +properties: + $nodename: + pattern: '^gpio-virtio@[0-9]+$' + + reg: + description: + The cell is the device ID of the GPIO device (VIRTIO_ID_GPIO) as per + dt-bindings/virtio/virtio_ids.h. + const: 41 + $ref: /schemas/virtio/mmio.yaml#/properties/reg + + gpio-controller: true + + "#gpio-cells": + const: 2 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + +required: + - reg + - gpio-controller + - "#gpio-cells" + +additionalProperties: false + +examples: + - | + #include + + virtio@3000 { + compatible = "virtio,mmio"; + reg = <0x3000 0x100>; + interrupts = <41>; + + #address-cells = <1>; + #size-cells = <0>; + + gpio-virtio@0 { + reg = ; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + +...