Skip to content

Commit f1aa30a

Browse files
committed
Merge tag 'tegra-for-7.1-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
firmware: tegra: Changes for v7.1-rc1 This introduces a new API for the BPMP to be pass along a specifier from DT when getting a reference from a phandle. This is used to reference specific instances of the PCI controller on Tegra264. The ABI header for BPMP is updated to the latest version and BPMP APIs now use the more intuitive ENODEV instead of the non SUSV4 ENOTSUPP error code for stub implementations. * tag 'tegra-for-7.1-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: bpmp: Use ENODEV instead of ENOTSUPP firmware: tegra: bpmp: Add tegra_bpmp_get_with_id() function soc/tegra: Update BPMP ABI header firmware: tegra: bpmp: Rename Tegra239 to Tegra238 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 86f9823 + e68d494 commit f1aa30a

3 files changed

Lines changed: 3741 additions & 918 deletions

File tree

drivers/firmware/tegra/bpmp.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,40 @@ channel_to_ops(struct tegra_bpmp_channel *channel)
3232
return bpmp->soc->ops;
3333
}
3434

35+
struct tegra_bpmp *tegra_bpmp_get_with_id(struct device *dev, unsigned int *id)
36+
{
37+
struct platform_device *pdev;
38+
struct of_phandle_args args;
39+
struct tegra_bpmp *bpmp;
40+
int err;
41+
42+
err = __of_parse_phandle_with_args(dev->of_node, "nvidia,bpmp", NULL,
43+
1, 0, &args);
44+
if (err < 0)
45+
return ERR_PTR(err);
46+
47+
pdev = of_find_device_by_node(args.np);
48+
if (!pdev) {
49+
bpmp = ERR_PTR(-ENODEV);
50+
goto put;
51+
}
52+
53+
bpmp = platform_get_drvdata(pdev);
54+
if (!bpmp) {
55+
bpmp = ERR_PTR(-EPROBE_DEFER);
56+
put_device(&pdev->dev);
57+
goto put;
58+
}
59+
60+
if (id)
61+
*id = args.args[0];
62+
63+
put:
64+
of_node_put(args.np);
65+
return bpmp;
66+
}
67+
EXPORT_SYMBOL_GPL(tegra_bpmp_get_with_id);
68+
3569
struct tegra_bpmp *tegra_bpmp_get(struct device *dev)
3670
{
3771
struct platform_device *pdev;

0 commit comments

Comments
 (0)