soc: qcom: Add socinfo driver
Subsystems (2)
PATCH v2 2/5 soc: qcom: Add socinfo driver
From: Imran Khan <[email protected]>
The Qualcomm socinfo driver exposes information about the SoC, its version and its serial number to user space.
Signed-off-by Imran Khan <[email protected]>
[Bjorn: Extract code to platform_driver, split patch in multiple]
Signed-off-by Bjorn Andersson <[email protected]>
[Vaishali: Simplify declarations, introduce qcom_socinfo struc, Fix
memory leak, Remove extra code and Misc code refactoring]
Signed-off-by Vaishali Thakkar <[email protected]>
---
Changes since v1:
- None
--- drivers/soc/qcom/Kconfig | 8 ++ drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/smem.c | 8 ++ drivers/soc/qcom/socinfo.c | 197 +++++++++++++++++++++++++++++++++++++ 4 files changed, 214 insertions(+) create mode 100644 drivers/soc/qcom/socinfo.c
drivers/soc/qcom/Kconfig +8 -0
@@ -144,6 +144,14 @@ config QCOM_SMSM Say yes here to support the Qualcomm Shared Memory State Machine. The state machine is represented by bits in shared memory. +config QCOM_SOCINFO + tristate "Qualcomm socinfo driver" + depends on QCOM_SMEM + select SOC_BUS + help + Say yes here to support the Qualcomm socinfo driver, providing + information about the SoC to user space. + config QCOM_WCNSS_CTRL tristate "Qualcomm WCNSS control driver" depends on ARCH_QCOM || COMPILE_TEST
drivers/soc/qcom/Makefile +1 -0
@@ -14,6 +14,7 @@ qcom_rpmh-y += rpmh-rsc.o qcom_rpmh-y += rpmh.o obj-$(CONFIG_QCOM_SMD_RPM) += smd-rpm.o obj-$(CONFIG_QCOM_SMEM) += smem.o +obj-$(CONFIG_QCOM_SOCINFO) += socinfo.o obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o obj-$(CONFIG_QCOM_SMP2P) += smp2p.o obj-$(CONFIG_QCOM_SMSM) += smsm.o
drivers/soc/qcom/smem.c +8 -0
@@ -276,6 +276,7 @@ struct qcom_smem {struct smem_partition_header *partitions[SMEM_HOST_COUNT ];size_t cacheline[SMEM_HOST_COUNT ];u32 item_count; +struct platform_device *socinfo;unsigned num_regions;struct smem_region regions[];
@@ -971,11 +972,18 @@ static int qcom_smem_probe(struct platform_device *pdev) __smem = smem; + smem->socinfo =platform_device_register_data (&pdev->dev,"qcom-socinfo" , +PLATFORM_DEVID_NONE ,NULL , +0 ); +if (IS_ERR (smem->socinfo)) +dev_err (&pdev->dev,"failed to register socinfo device\n" ); +return 0 ; }static int qcom_smem_remove (struct platform_device *pdev) { +hwspin_lock_free (__smem->hwlock); __smem =NULL ;
drivers/soc/qcom/socinfo.c new file +197 -0
197 lines not on this page · raw message
Signature · 1 line
2.17.1