From nobody Fri Dec 19 04:57:27 2025 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 364F7198A07 for ; Thu, 19 Dec 2024 13:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734613676; cv=none; b=OuYQkwafD4766g4V9ro7CfatrdE8kvgehs1sWqbqGvrJ1IJJeu1FWnuRCYuiyACs1++Iu2gW+lAboq2sseiB3gXTvXm/76/MmIKoekbVNQXQ1JAyPdnAlWuhNHT8CDJL3F7LPVh/gLfU2+yhVLCwLGptGNDYHBz1/9a/5e9eiSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734613676; c=relaxed/simple; bh=1yf/YbX5zzLVOPLgM9Mf3iD1fLxwVX2uCkX7LRhP57Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sXc4+0IqkSBl9Ug39zy3dyQIhdtJ1VD5Kb+H4dUbEpTl4lc0/hMmWwmKCNe3RaumGHZomghQqosdH/zd/h3JSyG1L8VNcQdCQTl7QZAij/pd5DDevbCB0KcPHxkKG8VeQkD0tpIPJ3EFbQVzMRIZcTykb/xljzI5H3B9IGh+QX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IG1GgAY6; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IG1GgAY6" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3862a921123so521614f8f.3 for ; Thu, 19 Dec 2024 05:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734613673; x=1735218473; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kmXfi4pLydKjD6u763/ay56dg5zTGdHbtmPA5MycJws=; b=IG1GgAY624pKivmCJPKy/QzbDsgBkHKtsX1/UeAdJUK0WCfC/pf6KYfwm9k/cTkEng sqaU0xhoXiHCl5SzdFPxNqHPjAjSPR9gScWSbMH8vCPVU7fqdZpk+Y1Q6Pv/YC4T/yav VU0M6fXOai3EKhcr2O4O3/Zn0hpV7sK7eocD1CA5We3zNqrD/BimXluWvIvBv/bW/x+d 9Bs1UjrOAIzffu6h969E65UbIUeaH8D3boxai7ZL54+8m0H9uv4ibfaUIA9W7lmRHebq GD+DvCTZeJNeByj7sCcYGxeBT4IlCP4sPefHtIe1L4VRau7lxBxgapweZB7VtMCmskZl 2c1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734613673; x=1735218473; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kmXfi4pLydKjD6u763/ay56dg5zTGdHbtmPA5MycJws=; b=ZYvHqkHQXiaoXHuBITyOi2PuNuVdb/RPYZlODDZyTLc4tyDVF0YKxZVs1n17M5ohdB FNa/Ei0v0PAZ9C7TyFkmOsbkRgootPuBltEBAPhNNI+NfPam/X6OAdbl9lKSENmzXAnQ 1y/WaDjHgt7v8TLAhfe/21eVqI8ysVJQ+dUE1uMp4t4+ye+Ah11O6+fCjBuo9AXMWhYp AUgzWEmm2wC7Kudrl90/BVXXL3IX2ub7Bg4j7hBgTL8cqY7fK8kTpKp6NvhKfHHQJ9Q0 JPPwaxoxpkHtgTfBQo2beBgDCES/SRzWcvhZ7w/BReP+aI9wJFqdyqe6J94ExUVGdoWG cqYw== X-Gm-Message-State: AOJu0YzfXcK54wVB3E98+fE0lyaWvLsP1s/666SY3O2Ctl31/I6V3w8k VZJNkOhWt3BILhN0N7DhXYP/wNJe3XZ3yOZQ7ae44a5vSKk3+wEOQ3DU6cjtu9g= X-Gm-Gg: ASbGncuopbCCjzI0U2FbSpTpGP8WgGBA1TQYYMnSZ1PHORWcwoL3WPIqRS7PEzJzUzI tZPqXPk8mNmtdvyZTq6igrRA0acu4wLZsZRdhwoDO5KkNNLImaNu/h3Njylpr0jQWkfQLuP6bVI 3bCM8pAUsQE16wVf/xXmTOZR5nXa05Y705LKDfgpNsoaYRmaBDmAwGnRD+A48jGwe0IscHj1lCc ecFJm+Bb8VjVCaQhhC60oiEjaum1rHPklFrcxrYHzDR3es2cj09WuqyxEhIK5ectCgbMV/OMakp HBCsYUpC7C6JhgvAdlIakbUGrKx0bemqNoQs X-Google-Smtp-Source: AGHT+IF40kzvTmeRV0SLh7JPWC/BmStsOxDXj25ZVmdU7p18eSuHRlcLVaylhOrmOqfz9B6DJ2UrcQ== X-Received: by 2002:a5d:5f90:0:b0:385:f0c9:4b66 with SMTP id ffacd0b85a97d-388e4d64767mr6779273f8f.33.1734613673423; Thu, 19 Dec 2024 05:07:53 -0800 (PST) Received: from ta2.c.googlers.com (130.173.34.34.bc.googleusercontent.com. [34.34.173.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea387sm17436705e9.6.2024.12.19.05.07.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 05:07:52 -0800 (PST) From: Tudor Ambarus Date: Thu, 19 Dec 2024 13:07:46 +0000 Subject: [PATCH 1/2] dt-bindings: mailbox: add support for referencing controllers solely by node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241219-mbox_request_channel_by_args-v1-1-617a6910f842@linaro.org> References: <20241219-mbox_request_channel_by_args-v1-0-617a6910f842@linaro.org> In-Reply-To: <20241219-mbox_request_channel_by_args-v1-0-617a6910f842@linaro.org> To: Jassi Brar , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, ulf.hansson@linaro.org, arnd@arndb.de, Tudor Ambarus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734613671; l=1946; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=1yf/YbX5zzLVOPLgM9Mf3iD1fLxwVX2uCkX7LRhP57Y=; b=73v7sR57R4aQx/YJWHUxGp/CxrhVmSD74UnblBJ4DVkdsJAKq1xaT2O5VdZSGL1GGLJRbSanH 61XYqh9IhL6AXZvYy040Qec9Tor97M/d9bMF8JF4KqLS+B5w682WxlH X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= There are mailbox clients that can discover the mailbox channel ID at run-time. For such cases passing the channel identifier via DT is redundant. Add support for referencing controllers solely by node. Signed-off-by: Tudor Ambarus --- Documentation/devicetree/bindings/mailbox/mailbox.txt | 19 +++++++++++++++= ---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/mailbox.txt b/Docume= ntation/devicetree/bindings/mailbox/mailbox.txt index af8ecee2ac68..0c4295a62f61 100644 --- a/Documentation/devicetree/bindings/mailbox/mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/mailbox.txt @@ -5,9 +5,10 @@ assign appropriate mailbox channel to client drivers. =20 * Mailbox Controller =20 -Required property: -- #mbox-cells: Must be at least 1. Number of cells in a mailbox - specifier. +Optional property: +- #mbox-cells: Must be at least 1. Number of cells in a mailbox specifier. + The property becomes mandatory for the cases where the clie= nts + reference the controller via the mboxes property. =20 Example: mailbox: mailbox { @@ -19,7 +20,11 @@ Example: * Mailbox Client =20 Required property: +Clients must reference the mailbox controller either via the mboxes or mbox +properties. - mboxes: List of phandle and mailbox channel specifiers. +- mbox: phandle pointing to the controller. Used by clients that can disco= ver + the channel identifiers at runtime. =20 Optional property: - mbox-names: List of identifier strings for each mailbox channel. @@ -29,7 +34,13 @@ Optional property: communication between the mailbox client and the remote. =20 =20 -Example: +Example using mbox: + power-management { + ... + mbox =3D <&mailbox>; + }; + +Example using mboxes: pwr_cntrl: power { ... mbox-names =3D "pwr-ctrl", "rpc"; --=20 2.47.1.613.gc27f4b7a9f-goog From nobody Fri Dec 19 04:57:27 2025 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 343022236FF for ; Thu, 19 Dec 2024 13:07:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734613678; cv=none; b=JtCn/qQcmQ9OvO5VtJ+GRJbbj952OwAgzetjn6FbsHKgQrlEFR3qc90s0F9au2CO3/zTjAwBRmmBnrwQrEC9z4vjBGZl0H0zEAkqzMbQrfB64KBDVypljV0kDmXZMzQB8ufxAFEaEehEkLrnqIyj5Sm0t0X/QlRuOgseV1n0rtM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734613678; c=relaxed/simple; bh=Q2/Ilfy56ojSZu1+fOIemD2xiXcbZHn9eQaGm8k0miI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V8EIssTsadBrF9f89eEgMA8Ik38h5vVSCtAlWv//W0ibvGq8eCueE8gFxBr1+UNmUXTEO27YrPjoPR/KW/X7s14b4wRkhg6nTBL7yGa6XUk6X3kRy/vkEBRQcvhhZnKMfIFa2NO0/18178q7BTADmTT4Q1nmxLTCUyrwYv7/MSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=vM2w2UZf; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vM2w2UZf" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso5454275e9.0 for ; Thu, 19 Dec 2024 05:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734613674; x=1735218474; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AUOQPXTRe3lg7UV1cQpho3gjLjQwoiMIh3ZBdN3lBVY=; b=vM2w2UZfTgGQ1TWvMZe5Z05/bs0aPR0XP6U/OW9xAihQrYRWBnJVHPZneHg0Siiu6E EQuWZj1QOg3LAsTdTu/cwKF9a5Zv1ZrstBi/ONNegZnXFakAYNqcMDXQc3UnjbgUW31Y rCEE6QVvpTd0yz5HOYSsEFHrOMtMv0tKkm242z6nwZHSDDpGzjS06xEJTTtCmCdPlEK6 N2b/sgnYlMVEUkxvXizukbp12MpBPmJ5DC8Pl17DyAAll3Py4WLhk+oPfzn58jexUSPV yWgpjF8s0ynLbmhjSyZUVaaWOZwVDfon8YIoz0q6WvcxXzsigjrCRqkmLaVT1wTJdnQp HDKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734613674; x=1735218474; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AUOQPXTRe3lg7UV1cQpho3gjLjQwoiMIh3ZBdN3lBVY=; b=SpgS2n2X7D9O6I6tPdKKjhmIMy2VsRqKJ361fRoCiu9THODdu7l41xgwsZzZ2YFaYK Aee6icS21SMyRjSrdMgLQxVWjquh3DLIAUvRvN+BSBVPIEzJfI1Oxk+G4rJhAssIoO3E Niem3RLYMncSh+g/12qmQFScpxyzscXn0zm/nPGLd6vsMrIGzHXBH/gyGPtI0ZKp6WLz jsVakCC7iE+O29Yke50+fRbdngljcs/eDNTIfLX5bKhHZIZpmFOABKOGF92pvRrua9Gw 8f8FZY17BC7aMoU71ChvRUA26eFdP5dhLC3tAnFZXSRAfYWMTBDjmmd7U5gkvrxKRf/C o2lw== X-Gm-Message-State: AOJu0Yxo5TKHgUtfMpIvHtnihLFokHJwIBL4MdY4GPfdSsAYjRMn/t1L StxZsg6PAUx2c9ap/35wWMglHV43PNgV4hGDHJSkc42i+BqM3Vg5k5rORvkvYn8= X-Gm-Gg: ASbGncvNhZI7OOV00sCCp7sHJsXCHeYIYIMRzcje2uBSpBzxTP8Mx5ab8S2k9ESPTxm XSE8IFNh5Ig1N/kOOtctAkF/6sYvFOPNoKaA/faq0uPuyHxhAa5o+mfq7MH1PmbBeESj7sv9j4O 5cjPsKix6E1K84uKKh0IWvLzG3LfpS0MKCnjQ4NC32ynSslbX9CQVvQHYEOhdKxWrKoar2A0QTD IchSNrhPoVrRqJ+IKCKVeH1EFhae4s6r13pvIBKPynJ1crvahBRjA9HbQBf3ZrXgcLdg988UEQI RJgtWZulOJUiFwAtKa1TS8xA5fdPo40UJGGp X-Google-Smtp-Source: AGHT+IH7QXzVbmArkNE6kY0mh8UxCymkYvZfRaYwodpZUWknXO1JZt6pMIJoZmzQeGk94zIBsb8bHw== X-Received: by 2002:a05:600c:350c:b0:436:1c04:aa8e with SMTP id 5b1f17b1804b1-4365c7942b6mr32991725e9.16.1734613674393; Thu, 19 Dec 2024 05:07:54 -0800 (PST) Received: from ta2.c.googlers.com (130.173.34.34.bc.googleusercontent.com. [34.34.173.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611ea387sm17436705e9.6.2024.12.19.05.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 05:07:53 -0800 (PST) From: Tudor Ambarus Date: Thu, 19 Dec 2024 13:07:47 +0000 Subject: [PATCH 2/2] mailbox: add support for clients to request channels by arguments Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241219-mbox_request_channel_by_args-v1-2-617a6910f842@linaro.org> References: <20241219-mbox_request_channel_by_args-v1-0-617a6910f842@linaro.org> In-Reply-To: <20241219-mbox_request_channel_by_args-v1-0-617a6910f842@linaro.org> To: Jassi Brar , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andre.draszik@linaro.org, peter.griffin@linaro.org, kernel-team@android.com, willmcvicker@google.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, ulf.hansson@linaro.org, arnd@arndb.de, Tudor Ambarus X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734613671; l=5667; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=Q2/Ilfy56ojSZu1+fOIemD2xiXcbZHn9eQaGm8k0miI=; b=DjvbKV9+OxuCn/g6zNLfMtnGo0ac9oiSZ61hg9UOxS8u84Deij/SZOVt8RZG/MWpoV+4CNVYI JGsGxeG3VrmBjbJEriNyu7OXAB4fQa5a+qF3YVvdcTl7LG3+UQDNJyw X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= There are clients that can discover channel identifiers at runtime by parsing a shared memory for example, as in the ACPM interface's case. Supply a new framework API: mbox_request_channel_by_args(). It works by supplying the usual client pointer as the first argument and a pointer to a ``const struct mbox_xlate_args`` as a second. The newly introduced struct is modeled after ``struct of_phandle_args``. The API will search the client's node for a ``mbox`` phandle, identify the controller's device node, and then call that controller's xlate() method that will return a pointer to a mbox_chan or a ERR_PTR. The binding between the channel and the client is done in the typical way. Signed-off-by: Tudor Ambarus --- drivers/mailbox/mailbox.c | 57 ++++++++++++++++++++++++++++++++++= ++++ include/linux/mailbox.h | 17 ++++++++++++ include/linux/mailbox_client.h | 3 ++ include/linux/mailbox_controller.h | 4 +++ 4 files changed, 81 insertions(+) diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index d3d26a2c9895..07ea32ebab80 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -467,6 +467,63 @@ struct mbox_chan *mbox_request_channel_byname(struct m= box_client *cl, } EXPORT_SYMBOL_GPL(mbox_request_channel_byname); =20 +/** + * mbox_request_channel_by_args - request a mailbox channel using client's + * channel identifiers. + * @cl: identity of the client requesting the channel. + * @spec: arguments that describe the channel. + * + * Used by clients that can discover the channel identifiers at runtime (by + * parsing a shared memory for example). The description of + * mbox_request_channel() applies here as well. + * + * Return: Pointer to the channel assigned to the client if successful. + * ERR_PTR for request failure. + */ +struct mbox_chan *mbox_request_channel_by_args(struct mbox_client *cl, + const struct mbox_xlate_args *spec) +{ + struct device *dev =3D cl->dev; + struct mbox_controller *mbox; + struct device_node *mbox_np; + struct mbox_chan *chan; + int ret; + + if (!dev || !dev->of_node) { + pr_debug("%s: No owner device node\n", __func__); + return ERR_PTR(-ENODEV); + } + + mbox_np =3D of_parse_phandle(dev_of_node(dev), "mbox", 0); + if (!mbox_np) + return ERR_PTR(-ENODEV); + + mutex_lock(&con_mutex); + + chan =3D ERR_PTR(-EPROBE_DEFER); + list_for_each_entry(mbox, &mbox_cons, node) + if (mbox->dev->of_node =3D=3D mbox_np && mbox->xlate) { + chan =3D mbox->xlate(mbox, spec); + if (!IS_ERR(chan)) + break; + } + + of_node_put(mbox_np); + + if (IS_ERR(chan)) { + mutex_unlock(&con_mutex); + return chan; + } + + ret =3D __mbox_bind_client(chan, cl); + if (ret) + chan =3D ERR_PTR(ret); + + mutex_unlock(&con_mutex); + return chan; +} +EXPORT_SYMBOL_GPL(mbox_request_channel_by_args); + /** * mbox_free_channel - The client relinquishes control of a mailbox * channel by this call. diff --git a/include/linux/mailbox.h b/include/linux/mailbox.h new file mode 100644 index 000000000000..cef88c5ae49d --- /dev/null +++ b/include/linux/mailbox.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright 2024 Linaro Ltd. + */ + +#ifndef __LINUX_MAILBOX_H +#define __LINUX_MAILBOX_H + +#include + +#define MBOX_XLATE_MAX_ARGS 16 +struct mbox_xlate_args { + int args_count; + u32 args[MBOX_XLATE_MAX_ARGS]; +}; + +#endif /* __LINUX_MAILBOX_H */ diff --git a/include/linux/mailbox_client.h b/include/linux/mailbox_client.h index 734694912ef7..a9f4d108c48c 100644 --- a/include/linux/mailbox_client.h +++ b/include/linux/mailbox_client.h @@ -9,6 +9,7 @@ =20 #include #include +#include =20 struct mbox_chan; =20 @@ -41,6 +42,8 @@ int mbox_bind_client(struct mbox_chan *chan, struct mbox_= client *cl); struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl, const char *name); struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index); +struct mbox_chan *mbox_request_channel_by_args(struct mbox_client *cl, + const struct mbox_xlate_args *spec); int mbox_send_message(struct mbox_chan *chan, void *mssg); int mbox_flush(struct mbox_chan *chan, unsigned long timeout); void mbox_client_txdone(struct mbox_chan *chan, int r); /* atomic */ diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_con= troller.h index 6fee33cb52f5..dfddcf966f9f 100644 --- a/include/linux/mailbox_controller.h +++ b/include/linux/mailbox_controller.h @@ -8,6 +8,7 @@ #include #include #include +#include =20 struct mbox_chan; =20 @@ -67,6 +68,7 @@ struct mbox_chan_ops { * @txpoll_period: If 'txdone_poll' is in effect, the API polls for * last TX's status after these many millisecs * @of_xlate: Controller driver specific mapping of channel via DT + * @xlate: Controller driver specific mapping of channel * @poll_hrt: API private. hrtimer used to poll for TXDONE on all * channels. * @node: API private. To hook into list of controllers. @@ -81,6 +83,8 @@ struct mbox_controller { unsigned txpoll_period; struct mbox_chan *(*of_xlate)(struct mbox_controller *mbox, const struct of_phandle_args *sp); + struct mbox_chan *(*xlate)(struct mbox_controller *mbox, + const struct mbox_xlate_args *sp); /* Internal to API */ struct hrtimer poll_hrt; spinlock_t poll_hrt_lock; --=20 2.47.1.613.gc27f4b7a9f-goog