mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
tegra/platform: Add driver for firmware class and inventory
Add driver for common utility API for firmware class and dumping the inventory for all firmware. Bug 3583607 Change-Id: I259bc7f80b8842cea090f67b067f63e5f85cb79c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2708890 GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
66d1a0786d
commit
a01851131c
54
include/linux/tegra-firmwares.h
Normal file
54
include/linux/tegra-firmwares.h
Normal file
@@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// Copyright (c) 2022, NVIDIA CORPORATION, All rights reserved.
|
||||
|
||||
#ifndef __TEGRA_FIRMWARES_H
|
||||
#define __TEGRA_FIRMWARES_H
|
||||
|
||||
/*
|
||||
* max size of version string
|
||||
*/
|
||||
#define TFW_VERSION_MAX_SIZE 256
|
||||
|
||||
struct device *tegrafw_register(const char *name,
|
||||
const u32 flags,
|
||||
ssize_t (*reader)(struct device *dev, char *, size_t),
|
||||
const char *string);
|
||||
void tegrafw_unregister(struct device *fwdev);
|
||||
struct device *devm_tegrafw_register(struct device *dev,
|
||||
const char *name,
|
||||
const u32 flags,
|
||||
ssize_t (*reader)(struct device *dev, char *, size_t),
|
||||
const char *string);
|
||||
void devm_tegrafw_unregister(struct device *dev, struct device *fwdev);
|
||||
void tegrafw_invalidate(struct device *fwdev);
|
||||
struct device *devm_tegrafw_register_dt_string(struct device *dev,
|
||||
const char *name,
|
||||
const char *path,
|
||||
const char *property);
|
||||
enum {
|
||||
TFW_NORMAL = 0x0000,
|
||||
TFW_DONT_CACHE = 0x0001,
|
||||
TFW_MAX = 0xFFFF,
|
||||
};
|
||||
|
||||
static inline struct device *tegrafw_register_string(const char *name,
|
||||
const char *string)
|
||||
{
|
||||
return tegrafw_register(name, TFW_NORMAL, NULL, string);
|
||||
}
|
||||
|
||||
static inline struct device *devm_tegrafw_register_string(struct device *dev,
|
||||
const char *name,
|
||||
const char *string)
|
||||
{
|
||||
return devm_tegrafw_register(dev, name, TFW_NORMAL, NULL, string);
|
||||
}
|
||||
|
||||
static inline struct device *tegrafw_register_dt_string(const char *name,
|
||||
const char *path,
|
||||
const char *property)
|
||||
{
|
||||
return devm_tegrafw_register_dt_string(NULL, name, path, property);
|
||||
}
|
||||
|
||||
#endif /* __TEGRA_FIRMWARES_CLASS */
|
||||
Reference in New Issue
Block a user