Loading drivers/soc/qcom/cmd-db.c +15 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define MAX_SLV_ID 8 #define SLAVE_ID_MASK 0x7 #define SLAVE_ID_SHIFT 16 #define CMD_DB_STANDALONE_MASK BIT(0) /** * struct entry_header: header for each entry in cmddb Loading Loading @@ -271,6 +272,17 @@ enum cmd_db_hw_type cmd_db_read_slave_id(const char *id) } EXPORT_SYMBOL(cmd_db_read_slave_id); int cmd_db_is_standalone(void) { int ret = cmd_db_ready(); if (!ret) return !!(cmd_db_header->reserved & CMD_DB_STANDALONE_MASK); return ret; } EXPORT_SYMBOL(cmd_db_is_standalone); static int cmd_db_dev_probe(struct platform_device *pdev) { struct reserved_mem *rmem; Loading @@ -294,6 +306,9 @@ static int cmd_db_dev_probe(struct platform_device *pdev) return -EINVAL; } if (cmd_db_is_standalone() == 1) pr_info("Command DB is initialized in standalone mode.\n"); return 0; } Loading include/soc/qcom/cmd-db.h +5 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ size_t cmd_db_read_aux_data_len(const char *resource_id); enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id); int cmd_db_ready(void); int cmd_db_is_standalone(void); #else static inline u32 cmd_db_read_addr(const char *resource_id) { return 0; } Loading @@ -41,5 +43,8 @@ static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id) static inline int cmd_db_ready(void) { return -ENODEV; } static inline int cmd_db_is_standalone(void) { return -ENODEV; } #endif /* CONFIG_QCOM_COMMAND_DB */ #endif /* __QCOM_COMMAND_DB_H__ */ Loading
drivers/soc/qcom/cmd-db.c +15 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define MAX_SLV_ID 8 #define SLAVE_ID_MASK 0x7 #define SLAVE_ID_SHIFT 16 #define CMD_DB_STANDALONE_MASK BIT(0) /** * struct entry_header: header for each entry in cmddb Loading Loading @@ -271,6 +272,17 @@ enum cmd_db_hw_type cmd_db_read_slave_id(const char *id) } EXPORT_SYMBOL(cmd_db_read_slave_id); int cmd_db_is_standalone(void) { int ret = cmd_db_ready(); if (!ret) return !!(cmd_db_header->reserved & CMD_DB_STANDALONE_MASK); return ret; } EXPORT_SYMBOL(cmd_db_is_standalone); static int cmd_db_dev_probe(struct platform_device *pdev) { struct reserved_mem *rmem; Loading @@ -294,6 +306,9 @@ static int cmd_db_dev_probe(struct platform_device *pdev) return -EINVAL; } if (cmd_db_is_standalone() == 1) pr_info("Command DB is initialized in standalone mode.\n"); return 0; } Loading
include/soc/qcom/cmd-db.h +5 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ size_t cmd_db_read_aux_data_len(const char *resource_id); enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id); int cmd_db_ready(void); int cmd_db_is_standalone(void); #else static inline u32 cmd_db_read_addr(const char *resource_id) { return 0; } Loading @@ -41,5 +43,8 @@ static inline enum cmd_db_hw_type cmd_db_read_slave_id(const char *resource_id) static inline int cmd_db_ready(void) { return -ENODEV; } static inline int cmd_db_is_standalone(void) { return -ENODEV; } #endif /* CONFIG_QCOM_COMMAND_DB */ #endif /* __QCOM_COMMAND_DB_H__ */