mirror of
https://github.com/torvalds/linux.git
synced 2026-04-27 19:12:29 -04:00
Upon probe the driver determines the vendor supporting the device. Expose this information in the revinfo debugfs file. Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221129135446.151065-7-arend.vanspriel@broadcom.com
48 lines
1.0 KiB
C
48 lines
1.0 KiB
C
/* SPDX-License-Identifier: ISC */
|
|
/*
|
|
* Copyright (c) 2022 Broadcom Corporation
|
|
*/
|
|
#ifndef FWVID_H_
|
|
#define FWVID_H_
|
|
|
|
#include "firmware.h"
|
|
|
|
struct brcmf_pub;
|
|
|
|
struct brcmf_fwvid_ops {
|
|
int (*attach)(struct brcmf_pub *drvr);
|
|
void (*detach)(struct brcmf_pub *drvr);
|
|
};
|
|
|
|
/* exported functions */
|
|
int brcmf_fwvid_register_vendor(enum brcmf_fwvendor fwvid, struct module *mod,
|
|
const struct brcmf_fwvid_ops *ops);
|
|
int brcmf_fwvid_unregister_vendor(enum brcmf_fwvendor fwvid, struct module *mod);
|
|
|
|
/* core driver functions */
|
|
int brcmf_fwvid_attach_ops(struct brcmf_pub *drvr);
|
|
void brcmf_fwvid_detach_ops(struct brcmf_pub *drvr);
|
|
const char *brcmf_fwvid_vendor_name(struct brcmf_pub *drvr);
|
|
|
|
static inline int brcmf_fwvid_attach(struct brcmf_pub *drvr)
|
|
{
|
|
int ret;
|
|
|
|
ret = brcmf_fwvid_attach_ops(drvr);
|
|
if (ret)
|
|
return ret;
|
|
|
|
return drvr->vops->attach(drvr);
|
|
}
|
|
|
|
static inline void brcmf_fwvid_detach(struct brcmf_pub *drvr)
|
|
{
|
|
if (!drvr->vops)
|
|
return;
|
|
|
|
drvr->vops->detach(drvr);
|
|
brcmf_fwvid_detach_ops(drvr);
|
|
}
|
|
|
|
#endif /* FWVID_H_ */
|