mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-11 06:38:05 +07:00
NFC: nci: Add nci init ops for early device initialization
Some device may need to execute some proprietary commands in order to "wake-up"; Before the nci state initialization. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
81859ab877
commit
c39daeee50
@ -73,6 +73,7 @@ struct nci_prop_ops {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct nci_ops {
|
struct nci_ops {
|
||||||
|
int (*init)(struct nci_dev *ndev);
|
||||||
int (*open)(struct nci_dev *ndev);
|
int (*open)(struct nci_dev *ndev);
|
||||||
int (*close)(struct nci_dev *ndev);
|
int (*close)(struct nci_dev *ndev);
|
||||||
int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
|
int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
|
||||||
|
@ -344,8 +344,13 @@ static int nci_open_device(struct nci_dev *ndev)
|
|||||||
|
|
||||||
set_bit(NCI_INIT, &ndev->flags);
|
set_bit(NCI_INIT, &ndev->flags);
|
||||||
|
|
||||||
rc = __nci_request(ndev, nci_reset_req, 0,
|
if (ndev->ops->init)
|
||||||
msecs_to_jiffies(NCI_RESET_TIMEOUT));
|
rc = ndev->ops->init(ndev);
|
||||||
|
|
||||||
|
if (!rc) {
|
||||||
|
rc = __nci_request(ndev, nci_reset_req, 0,
|
||||||
|
msecs_to_jiffies(NCI_RESET_TIMEOUT));
|
||||||
|
}
|
||||||
|
|
||||||
if (!rc && ndev->ops->setup) {
|
if (!rc && ndev->ops->setup) {
|
||||||
rc = ndev->ops->setup(ndev);
|
rc = ndev->ops->setup(ndev);
|
||||||
|
Loading…
Reference in New Issue
Block a user