Loading drivers/soc/qcom/cmd-db.c +14 −1 Original line number Diff line number Diff line /* Copyright (c) 2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -27,6 +27,7 @@ #define CMD_DB_MAGIC 0x0C0330DBUL #define SLAVE_ID_MASK 0x7 #define SLAVE_ID_SHIFT 16 #define CMD_DB_STANDALONE_MASK BIT(0) struct entry_header { uint64_t res_id; Loading Loading @@ -220,6 +221,14 @@ int cmd_db_ready(void) return cmd_db_status; } int cmd_db_is_standalone(void) { if (cmd_db_status < 0) return cmd_db_status; return !!(cmd_db_header->reserved & CMD_DB_STANDALONE_MASK); } int cmd_db_get_slave_id(const char *resource_id) { int ret; Loading Loading @@ -259,6 +268,10 @@ static int cmd_db_dev_probe(struct platform_device *pdev) } cmd_db_status = 0; of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); if (cmd_db_is_standalone() == 1) pr_info("Command DB is initialized in standalone mode.\n"); failed: return cmd_db_status; } Loading include/soc/qcom/cmd-db.h +13 −1 Original line number Diff line number Diff line /* Copyright (c) 2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -96,6 +96,13 @@ int cmd_db_ready(void); * return cmd_db_hw_type enum on success, errno on error */ int cmd_db_get_slave_id(const char *resource_id); /** * cmd_db_is_standalone - Returns if the command DB is standalone * * return 1 if command DB is standalone, 0 if not, errno otherwise. */ int cmd_db_is_standalone(void); #else static inline u32 cmd_db_get_addr(const char *resource_id) Loading Loading @@ -132,5 +139,10 @@ int cmd_db_get_slave_id(const char *resource_id) { return -ENODEV; } int cmd_db_is_standalone(void) { return -ENODEV; } #endif #endif Loading
drivers/soc/qcom/cmd-db.c +14 −1 Original line number Diff line number Diff line /* Copyright (c) 2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -27,6 +27,7 @@ #define CMD_DB_MAGIC 0x0C0330DBUL #define SLAVE_ID_MASK 0x7 #define SLAVE_ID_SHIFT 16 #define CMD_DB_STANDALONE_MASK BIT(0) struct entry_header { uint64_t res_id; Loading Loading @@ -220,6 +221,14 @@ int cmd_db_ready(void) return cmd_db_status; } int cmd_db_is_standalone(void) { if (cmd_db_status < 0) return cmd_db_status; return !!(cmd_db_header->reserved & CMD_DB_STANDALONE_MASK); } int cmd_db_get_slave_id(const char *resource_id) { int ret; Loading Loading @@ -259,6 +268,10 @@ static int cmd_db_dev_probe(struct platform_device *pdev) } cmd_db_status = 0; of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); if (cmd_db_is_standalone() == 1) pr_info("Command DB is initialized in standalone mode.\n"); failed: return cmd_db_status; } Loading
include/soc/qcom/cmd-db.h +13 −1 Original line number Diff line number Diff line /* Copyright (c) 2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -96,6 +96,13 @@ int cmd_db_ready(void); * return cmd_db_hw_type enum on success, errno on error */ int cmd_db_get_slave_id(const char *resource_id); /** * cmd_db_is_standalone - Returns if the command DB is standalone * * return 1 if command DB is standalone, 0 if not, errno otherwise. */ int cmd_db_is_standalone(void); #else static inline u32 cmd_db_get_addr(const char *resource_id) Loading Loading @@ -132,5 +139,10 @@ int cmd_db_get_slave_id(const char *resource_id) { return -ENODEV; } int cmd_db_is_standalone(void) { return -ENODEV; } #endif #endif