1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2022, Linaro Ltd 4 */ 5 #ifndef __SOC_QCOM_PMIC_GLINK_H__ 6 #define __SOC_QCOM_PMIC_GLINK_H__ 7 8 struct pmic_glink; 9 struct pmic_glink_client; 10 11 #define PMIC_GLINK_OWNER_BATTMGR 32778 12 #define PMIC_GLINK_OWNER_USBC 32779 13 #define PMIC_GLINK_OWNER_USBC_PAN 32780 14 15 #define PMIC_GLINK_REQ_RESP 1 16 #define PMIC_GLINK_NOTIFY 2 17 18 struct pmic_glink_hdr { 19 __le32 owner; 20 __le32 type; 21 __le32 opcode; 22 }; 23 24 int pmic_glink_send(struct pmic_glink_client *client, void *data, size_t len); 25 26 struct pmic_glink_client *devm_pmic_glink_client_alloc(struct device *dev, 27 unsigned int id, 28 void (*cb)(const void *, size_t, void *), 29 void (*pdr)(void *, int), 30 void *priv); 31 void pmic_glink_client_register(struct pmic_glink_client *client); 32 33 #endif 34