From patchwork Wed Feb 20 04:58:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 158756 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4490165jaa; Tue, 19 Feb 2019 20:58:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IYOWyFXuBRkM4BHQtcKZMwytH6oIUYcDcyaF0u5i3BxuIeXxImEV36HW0Cn5qkhg+oY2fpD X-Received: by 2002:a17:902:7608:: with SMTP id k8mr34094023pll.245.1550638703704; Tue, 19 Feb 2019 20:58:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550638703; cv=none; d=google.com; s=arc-20160816; b=01r2b/o1rTj8u14AF4FJ4p+qmf5STIZWaXDi0NMpXkk6+QEjNLryrThAcoTujhdIhP ziAzszFvbtFQXYcMmPCC2UbHT1810iVbVCIo046+nL2h7PCgv1vyNOiQuTT4qB96bPeu mEEM7C1i03qsSwidku3rAkJ4k0QOLIG4a4jzaYlErwukRQvl38Jr7pBahI+vgcrXcC5s gfHytacQOeb+S6Bnw2RnetlqJ+t/snkZzmdoxNzcUKnAaKmlC669o5PKi7puJWYzoMLA V+qTeuVOtgLNNoxPzyTvXwzRAPQb34PlB+U5QE+UevuixsIBOZ1pQrPLB9LOJ7pno0eo 2k7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=1pBHjk3updZIvXBgasb0eUsMOw684uPryESYhpgXWVg=; b=oQeTrt+dAG8dIJUUeksa0W5zW0lnMTAwpIPFEc9TocLOnjXZA5U0u3E+dy+Piiv6kg sQ1DJeWgFfsCJ6oZh/+Zd7rRq98V0lfwP6UvgO7buiKMLVPC66jC4xTydXtan9fLZB0z 2sj4Qgk+wz4UqYNUvFW7WMgEuim+NWb2jt+Gwe/cqS24ejj9/UmShtV5AqFXgpZaFSn7 wkrovBSuuY+w8Jq5yW74Zfd17rKgSg8tvL5UYsJiB4f8PgukK5+Dy9luO2V5pSSgLvio jTv9bEpc6tL+QPEg1dOgC6VXyg+4S0xV8WCwJVRJ9JvIxbZiSeYcRZxhfM+ZQ88bhLGl gI0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WPHepq86; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si16392001pge.482.2019.02.19.20.58.23; Tue, 19 Feb 2019 20:58:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WPHepq86; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730436AbfBTE6W (ORCPT + 15 others); Tue, 19 Feb 2019 23:58:22 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44035 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728979AbfBTE6W (ORCPT ); Tue, 19 Feb 2019 23:58:22 -0500 Received: by mail-pf1-f195.google.com with SMTP id a3so1483694pff.11 for ; Tue, 19 Feb 2019 20:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=1pBHjk3updZIvXBgasb0eUsMOw684uPryESYhpgXWVg=; b=WPHepq86NLZctZfA8K7H+3xY6wWkQSQm+Nc1GYEetQqkjVaJycNmhVBgfm5MLpPMpl p9Q4yiDZCotJg8JtIhJ/mvKf/rAogN72vfY+44FCX4JnIy91y4JZbE/IqEdEJBbpddiN b0xDS3hEJFkQqh9wmuAn9+Qh0sqGve9JHmQnfxoFXCnXdzw4nlp6GtjX5FjcudiVmmzz Fj58Kbkb9ASzxNovZfvEkjMfMUryfzT5rjZ8m08Do3srEL7modXZcg6UTiLPUDdYv8GQ VOm0ELpy21tZQO4CBZ+at6CMrUhcBP73OTVMacDgWWRLs1AKGVx30De+OI5urjc/UcOn BsQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1pBHjk3updZIvXBgasb0eUsMOw684uPryESYhpgXWVg=; b=FtO0Itk9d3aSM6maAEPICfzrRSFsEWeoFl9Gd3l9RRlQdXV6JDDI9agyH1NmxLkbYJ kv+bWRrRwtuNeKixPoQ1ZzOzqsWIMmvJAAiXZs6CmXFUaYCbFKy5Fpok6hcMEDOJH+GE Rqevq0D3aDh+wcnQxyBXPYpjgarNwozi5mCK9JP/poECm1U6XZtfVVPv4ti3du2OFkqW QcrOSzi030JI7ExApQu1W8F0YQ2NoV5ysoAR/08R9tJORUPWoSxN/i12+lta5iFs4BPO n6GXoAINHHapz2smWTRupsbwpKsZx06Fp2SvKCqptf89aZvm6W+7C7aWZA2pJwbBRVlJ TANQ== X-Gm-Message-State: AHQUAua7CNNC/biqrStCLfeBjgDyzYKef4C+FwiLCFhsCRUFjTjw3Uer C2qrJSaUuLivHg1U9Zuk+VScbw== X-Received: by 2002:a63:fd07:: with SMTP id d7mr26814868pgh.163.1550638701826; Tue, 19 Feb 2019 20:58:21 -0800 (PST) Received: from localhost.localdomain ([116.75.87.120]) by smtp.gmail.com with ESMTPSA id b70sm22464879pfm.6.2019.02.19.20.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 20:58:21 -0800 (PST) From: Vaishali Thakkar To: andy.gross@linaro.org Cc: david.brown@linaro.org, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org, Vaishali Thakkar Subject: [PATCH v2 1/5] base: soc: Add serial_number attribute to soc Date: Wed, 20 Feb 2019 10:28:13 +0530 Message-Id: <20190220045813.6756-1-vaishali.thakkar@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bjorn Andersson Add new attribute named "serial_number" as a standard interface for user space to acquire the serial number of the device. For ST-Ericsson SoCs this is exposed by the cryptically named "soc_id" attribute, but this provides a human readable standardized name for this property. Signed-off-by: Bjorn Andersson Signed-off-by: Vaishali Thakkar --- Changes since v1: - Make comment more clear for the case when serial number is not available --- Documentation/ABI/testing/sysfs-devices-soc | 7 +++++++ drivers/base/soc.c | 7 +++++++ include/linux/sys_soc.h | 1 + 3 files changed, 15 insertions(+) -- 2.17.1 diff --git a/Documentation/ABI/testing/sysfs-devices-soc b/Documentation/ABI/testing/sysfs-devices-soc index 6d9cc253f2b2..ba3a3fac0ee1 100644 --- a/Documentation/ABI/testing/sysfs-devices-soc +++ b/Documentation/ABI/testing/sysfs-devices-soc @@ -26,6 +26,13 @@ Description: Read-only attribute common to all SoCs. Contains SoC family name (e.g. DB8500). +What: /sys/devices/socX/serial_number +Date: January 2019 +contact: Bjorn Andersson +Description: + Read-only attribute supported by most SoCs. Contains the SoC's + serial number, if available. + What: /sys/devices/socX/soc_id Date: January 2012 contact: Lee Jones diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 10b280f30217..b0933b9fe67f 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -33,6 +33,7 @@ static struct bus_type soc_bus_type = { static DEVICE_ATTR(machine, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(family, S_IRUGO, soc_info_get, NULL); +static DEVICE_ATTR(serial_number, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(soc_id, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(revision, S_IRUGO, soc_info_get, NULL); @@ -57,6 +58,9 @@ static umode_t soc_attribute_mode(struct kobject *kobj, if ((attr == &dev_attr_revision.attr) && (soc_dev->attr->revision != NULL)) return attr->mode; + if ((attr == &dev_attr_serial_number.attr) + && (soc_dev->attr->serial_number != NULL)) + return attr->mode; if ((attr == &dev_attr_soc_id.attr) && (soc_dev->attr->soc_id != NULL)) return attr->mode; @@ -77,6 +81,8 @@ static ssize_t soc_info_get(struct device *dev, return sprintf(buf, "%s\n", soc_dev->attr->family); if (attr == &dev_attr_revision) return sprintf(buf, "%s\n", soc_dev->attr->revision); + if (attr == &dev_attr_serial_number) + return sprintf(buf, "%s\n", soc_dev->attr->serial_number); if (attr == &dev_attr_soc_id) return sprintf(buf, "%s\n", soc_dev->attr->soc_id); @@ -87,6 +93,7 @@ static ssize_t soc_info_get(struct device *dev, static struct attribute *soc_attr[] = { &dev_attr_machine.attr, &dev_attr_family.attr, + &dev_attr_serial_number.attr, &dev_attr_soc_id.attr, &dev_attr_revision.attr, NULL, diff --git a/include/linux/sys_soc.h b/include/linux/sys_soc.h index bed223b70217..2a13bc033bd6 100644 --- a/include/linux/sys_soc.h +++ b/include/linux/sys_soc.h @@ -12,6 +12,7 @@ struct soc_device_attribute { const char *machine; const char *family; const char *revision; + const char *serial_number; const char *soc_id; const void *data; }; From patchwork Wed Feb 20 04:58:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 158757 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4490353jaa; Tue, 19 Feb 2019 20:58:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZjmcRMRiCoq/1BqaAY2YL9LC5sSeQ0dl9V8nfRG0DufHpqEGyM0xD6eHE00SMNrkct4dQ4 X-Received: by 2002:a62:fb10:: with SMTP id x16mr19182437pfm.5.1550638717790; Tue, 19 Feb 2019 20:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550638717; cv=none; d=google.com; s=arc-20160816; b=RvHmCOfJ5j0Yc8DP9m5hPOp116SJYK/KDKBPwnbXzStkUBl0PSE0DgYpbUwYSV6yvI FLvCuxO/hluHikJfP8T5523gQDhw6+yVh4b7BYQzmxUQwv1IDhaGOJTDxrBw2etip9Qp JjiMCamcEZEodcubKX3QjqDYckUSF1CGGuW0rsQKjJTKXvviNnfCRkB7gF/p0ZA6C4AX 0RFCTxscBJjVLY+yCBsvUx0roWGrFFqOHfFvrM8rzCaGfHjnOoKFm/VzRCbARzhbosdO SkOirJ0DSpexd2VvkPjvYvlYw9HS5Z6d0xygMxHjHmNZIpBqowj3sUrhYT+dTFYtqrLy C1xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=aP2PBTKVQJlSigP/Kpc2H/Q1zBuILHSoQSkbr+YAZIo=; b=u1rpx03jMfDCgR8b85RTK0yDEc/aA3qwDsuW8IYGUhKKgBm7yw55yhqRm5yq0Ulps/ wFsIa+Syi+UwWE1KnqTMVSzFw7CwMRsVpEfL4xrxDwK1JZ0HwTdpT/2M3ZA6D5DLfUxx SsTKc1HY69SlNMEi9EUyuM7492hnSWXmR1QA5jlov7gUVvNU3wdg/TC7HMNCdaKoi0Mn tz6pKTrwUxlRRglt8FcwiMHJHDaaUXccd9vwkvRnnGN6iPinpYmFWox5AJvpV53Z7esk 03CAPNmgoGlBqmoNyLKZCHiZ8+P2QfnTM8LeXVg2syLsLAkZjquQva8Gi9U/V6u/K5zf PnVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P3OgG7tG; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13si18669119pld.72.2019.02.19.20.58.37; Tue, 19 Feb 2019 20:58:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P3OgG7tG; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730483AbfBTE6c (ORCPT + 15 others); Tue, 19 Feb 2019 23:58:32 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46137 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729770AbfBTE6c (ORCPT ); Tue, 19 Feb 2019 23:58:32 -0500 Received: by mail-pg1-f195.google.com with SMTP id w7so11212481pgp.13 for ; Tue, 19 Feb 2019 20:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aP2PBTKVQJlSigP/Kpc2H/Q1zBuILHSoQSkbr+YAZIo=; b=P3OgG7tGpW2kxFt9Cw0/Xol6B0swDuLq8cJwgGlbphOwZHkpFB4VLfUpAM/Babmm9O F0VO6W6tVHfCkiIMg4OWOy2+h+JvFsWIAc7M/1tanUik+1/tThB6i0NRWzZP0yT6JQTq B8bS3xLCeRa9Okt/v6/lln85hOfl12IWO0/tFf7hXCZdRgEexIwVqly5bni1/PLAJb8z C+MM7ayF754n4QeNE3tp70GIwhZZRaBsuA5trJ0aPaVZUpGII0JZa00U5DzDJQQqlpPw ID7X34Ao4BxvT4HhO3lXmGsqIz5h2UuyN+snm9aZYGa2/dG935wxxQEvhykv1G+e/HUl lYsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aP2PBTKVQJlSigP/Kpc2H/Q1zBuILHSoQSkbr+YAZIo=; b=GTzpl6vQj925lqiCPig2CMCvY4GDgiaCO+5rqT68Io4dbgzfNBxGy8nSW+NnzO+IJF S4mb6hcfw256fl4Zl2SXbc0uKqDeWDqRmD5ig93hP/OshOxO5opICJz9bGaXVlwgffoU P4EwX/EPctuIHZ2L0iYC68Ej+Nx0H9SRhYCUS8TJ7L5QGv/Fc0jHuJiVV429ZSf53ydS Q7FPJC6qrOV5A+gcuSOin3a0IBbg2MQjScWCJV2Nd4NftTjDtyi4e/httoflE8Pfq8Nw heJ7NcBRpSMap/GatYSeRXOzXHCpNzUSprWQ8UlZjDCWE7pNlni8OcVvtFfYRY4Rax2c kLnw== X-Gm-Message-State: AHQUAuYysQp+VTWM3HagJ1pv9B279E8fuPGKJi47Ur/q+jJ0SIFP5ZI/ wLppD3yALahe4mYhkqNnBBEJrA== X-Received: by 2002:a62:e082:: with SMTP id d2mr33934127pfm.240.1550638711476; Tue, 19 Feb 2019 20:58:31 -0800 (PST) Received: from localhost.localdomain ([116.75.87.120]) by smtp.gmail.com with ESMTPSA id n75sm37670235pfb.39.2019.02.19.20.58.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 20:58:30 -0800 (PST) From: Vaishali Thakkar To: andy.gross@linaro.org Cc: david.brown@linaro.org, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org, Imran Khan , Vaishali Thakkar Subject: [PATCH v2 2/5] soc: qcom: Add socinfo driver Date: Wed, 20 Feb 2019 10:28:23 +0530 Message-Id: <20190220045823.6802-1-vaishali.thakkar@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Imran Khan The Qualcomm socinfo driver exposes information about the SoC, its version and its serial number to user space. Signed-off-by: Imran Khan [Bjorn: Extract code to platform_driver, split patch in multiple] Signed-off-by: Bjorn Andersson [Vaishali: Simplify declarations, introduce qcom_socinfo struc, Fix memory leak, Remove extra code and Misc code refactoring] Signed-off-by: Vaishali Thakkar --- 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 -- 2.17.1 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index fcbf8a2e4080..1e31eda07934 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -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 diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index f25b54cd6cf8..c817da4f4140 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -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 diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index f80d040601fd..efe0b053ef82 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -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; diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c new file mode 100644 index 000000000000..02078049fac7 --- /dev/null +++ b/drivers/soc/qcom/socinfo.c @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2009-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019, Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * SoC version type with major number in the upper 16 bits and minor + * number in the lower 16 bits. + */ +#define SOCINFO_MAJOR(ver) (((ver) >> 16) & 0xffff) +#define SOCINFO_MINOR(ver) ((ver) & 0xffff) + +#define SMEM_SOCINFO_BUILD_ID_LENGTH 32 + +/* + * SMEM item ids, used to acquire handles to respective + * SMEM region. + */ +#define SMEM_HW_SW_BUILD_ID 137 + +/* Socinfo SMEM item structure */ +struct socinfo { + __le32 fmt; + __le32 id; + __le32 ver; + char build_id[SMEM_SOCINFO_BUILD_ID_LENGTH]; + /* Version 2 */ + __le32 raw_id; + __le32 raw_ver; + /* Version 3 */ + __le32 hw_plat; + /* Version 4 */ + __le32 plat_ver; + /* Version 5 */ + __le32 accessory_chip; + /* Version 6 */ + __le32 hw_plat_subtype; + /* Version 7 */ + __le32 pmic_model; + __le32 pmic_die_rev; + /* Version 8 */ + __le32 pmic_model_1; + __le32 pmic_die_rev_1; + __le32 pmic_model_2; + __le32 pmic_die_rev_2; + /* Version 9 */ + __le32 foundry_id; + /* Version 10 */ + __le32 serial_num; + /* Version 11 */ + __le32 num_pmics; + __le32 pmic_array_offset; + /* Version 12 */ + __le32 chip_family; + __le32 raw_device_family; + __le32 raw_device_num; +}; + +struct qcom_socinfo { + struct soc_device *soc_dev; + struct soc_device_attribute attr; +}; + +struct soc_of_id { + unsigned int id; + const char *name; +}; + +static const struct soc_of_id soc_of_id[] = { + {87, "MSM8960"}, + {109, "APQ8064"}, + {122, "MSM8660A"}, + {123, "MSM8260A"}, + {124, "APQ8060A"}, + {126, "MSM8974"}, + {130, "MPQ8064"}, + {138, "MSM8960AB"}, + {139, "APQ8060AB"}, + {140, "MSM8260AB"}, + {141, "MSM8660AB"}, + {178, "APQ8084"}, + {184, "APQ8074"}, + {185, "MSM8274"}, + {186, "MSM8674"}, + {194, "MSM8974PRO"}, + {206, "MSM8916"}, + {208, "APQ8074-AA"}, + {209, "APQ8074-AB"}, + {210, "APQ8074PRO"}, + {211, "MSM8274-AA"}, + {212, "MSM8274-AB"}, + {213, "MSM8274PRO"}, + {214, "MSM8674-AA"}, + {215, "MSM8674-AB"}, + {216, "MSM8674PRO"}, + {217, "MSM8974-AA"}, + {218, "MSM8974-AB"}, + {246, "MSM8996"}, + {247, "APQ8016"}, + {248, "MSM8216"}, + {249, "MSM8116"}, + {250, "MSM8616"}, + {291, "APQ8096"}, + {305, "MSM8996SG"}, + {310, "MSM8996AU"}, + {311, "APQ8096AU"}, + {312, "APQ8096SG"}, +}; + +static const char *socinfo_machine(struct device *dev, unsigned int id) +{ + int idx; + + for (idx = 0; idx < ARRAY_SIZE(soc_of_id); idx++) { + if (soc_of_id[idx].id == id) + return soc_of_id[idx].name; + } + + if (IS_ERR(soc_of_id[idx].name)) + dev_err(dev, "Unknown soc id\n"); + + return NULL; +} + +static int qcom_socinfo_probe(struct platform_device *pdev) +{ + struct qcom_socinfo *qs; + struct socinfo *info; + size_t item_size; + + info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, + &item_size); + if (IS_ERR(info)) { + dev_err(&pdev->dev, "Couldn't find socinfo\n"); + return -EINVAL; + } + + qs = devm_kzalloc(&pdev->dev, sizeof(*qs), GFP_KERNEL); + if (!qs) + return -ENOMEM; + + qs->attr.family = "Snapdragon"; + qs->attr.machine = socinfo_machine(&pdev->dev, + le32_to_cpu(info->id)); + qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u", + SOCINFO_MAJOR(le32_to_cpu(info->ver)), + SOCINFO_MINOR(le32_to_cpu(info->ver))); + if (le32_to_cpu(info->fmt) >= 10) + qs->attr.serial_number = devm_kasprintf(&pdev->dev, GFP_KERNEL, + "%u", + le32_to_cpu(info->serial_num)); + + qs->soc_dev = soc_device_register(&qs->attr); + if (IS_ERR(qs->soc_dev)) + return PTR_ERR(qs->soc_dev); + + /* Feed the soc specific unique data into entropy pool */ + add_device_randomness(info, item_size); + + platform_set_drvdata(pdev, qs->soc_dev); + + return 0; +} + +static int qcom_socinfo_remove(struct platform_device *pdev) +{ + struct qcom_socinfo *qs = platform_get_drvdata(pdev); + + soc_device_unregister(qs->soc_dev); + + return 0; +} + +static struct platform_driver qcom_socinfo_driver = { + .probe = qcom_socinfo_probe, + .remove = qcom_socinfo_remove, + .driver = { + .name = "qcom-socinfo", + }, +}; + +module_platform_driver(qcom_socinfo_driver); + +MODULE_DESCRIPTION("Qualcomm socinfo driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:qcom-socinfo"); From patchwork Wed Feb 20 04:58:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 158758 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4490363jaa; Tue, 19 Feb 2019 20:58:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IbdLKZlNqOVruSOupfqZ7Wl+pMqaKvscfl5ke5TGsZ0b9C0+tHpSnnD6ATkWGFhH6Nxy4VW X-Received: by 2002:aa7:82d7:: with SMTP id f23mr14850561pfn.114.1550638718554; Tue, 19 Feb 2019 20:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550638718; cv=none; d=google.com; s=arc-20160816; b=N1g6lfSUHawpsmLXiVpfq6vsZA84KEidbFaLEXK7rWzqsn3yUmLaCRe+q34LWl/8ck gpjTLrnJleTOOQ9TG/gdwv8AKAM1jv3Llin8L10fXsFu2tyIT61XsSpSOgNWsbvWjGww L9kCHgSoZBZwMudMYEhjZCa64rFSqcXU7bSDgmVjA6YtelCzu/kq0kby6eIVyVpp++OB /1S9jOaSjh0MUI/kP+uG/m4iTlnJW7oGseq+D2/mDnK5ULsDHierV6sQErjtjyxsXk8d 5azAU1qBYo6BPemudT9zBFzDYmILCZtAjunI1ze2I8VJWOtr5XIeMlp9OYdhUdTuwcTO 7tBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=k425mRU+Z5hM/Fx7iH6l24WC7zBNH3HFHJvyc2sDvCA=; b=ebTSOgF8VeC5s+NkX1vHnYesNpJvFgk9XmrHoTTKlpfi67GWaIANMc12wT4YZhELNh PDU9PP4iuDVz/WBVpQMQ/CH8mpyW5CMYJNMV6BhjQoa9v333pbHpMnqus0sFtjJN1aD3 k4k8MQmMo9a9zTlrWD9ywMird5OhKXtQoyWzM3mKnfHXG/Qi/urXKgGOjB7nNd73ogJ4 dT10VGV2aMideSbuWYrI8ML9vrqd3rp8PjHdTSwcw/SNLvJpbg2FEtFoxhguzr8VsdgK hTYgVwPo9SJnJMXCSN3kY6snHABJK8iEldOx1mZsGTQuf/ZL9U9PBtem+7e7a3NYpl5x 63Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LZ6FmqqK; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13si18669119pld.72.2019.02.19.20.58.38; Tue, 19 Feb 2019 20:58:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LZ6FmqqK; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730507AbfBTE6g (ORCPT + 15 others); Tue, 19 Feb 2019 23:58:36 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:40336 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730414AbfBTE6g (ORCPT ); Tue, 19 Feb 2019 23:58:36 -0500 Received: by mail-pf1-f193.google.com with SMTP id h1so11298218pfo.7 for ; Tue, 19 Feb 2019 20:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=k425mRU+Z5hM/Fx7iH6l24WC7zBNH3HFHJvyc2sDvCA=; b=LZ6FmqqKBD0GzYKEzyQ1JAEvl+B4rtrtO03ZenLFZsRqFHN7YeHQNVIfHqJeAGE/BO wtuHIMEkVmHTXLTlVTGKbCmC4JkHqhDu0YXybRa3gGxZ+3LqviHaYCM57CWaAMSXY7kP 3rJMBvYXZnKJ/ct1+LEhYHMW24P/Otwng9sN4F79MqFaQAwkG0aGDeL7YGdK+CcsdIZN 1MfgC9W3RbU1kGK9weBLEqxEtM2K1VW0vbylxRry/guy3qpi87CHvSu9yD83UPQQmoqR 6p5UbxH09sHS3IA3yD8KVvDt5CSF/UUtbKLFGldtMZVUbEaHe2syy+SzLbgwnjbH5QkJ lAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k425mRU+Z5hM/Fx7iH6l24WC7zBNH3HFHJvyc2sDvCA=; b=Oy8eZAyIa5VyrlkZ9A9DSH+tmhs519bzJOcKDMTUaFTcKEta0L4XC1Y1+9RgDjEj2+ 1+7MFt1hhHnvf1A7j6JLGKlzMgc85QqpTkNfy0RYs9sNv4q3shn7sYvj2Ru9ybvLuBSq XzIrZeo0atE5BISvmc1dbvgskggvkRe8DkQIWx80DdDedM/hvs7zdIZBvP5lRw5eb/Qo MXGeinDUtMo2B0rYrVAjlu4psz9ZBMcR8Ru7Q/8oSZ+FCsKadrphqGZHDerKbfkkbwvR 8mFkad5BeZG0ecCYTxhhDT9JZqBVh7E+WRoWTL/rl0o8speYVOQ87AtCNtr2qlSvyniC m3Fw== X-Gm-Message-State: AHQUAuaG7R+LPA4mFKNlZHydlZBaukquc+aDBaWttVdaHfNKbSTNiB5R aEFEV7cdoOn1UmLUPfD7WvzCQA== X-Received: by 2002:a62:29c3:: with SMTP id p186mr33414249pfp.117.1550638715407; Tue, 19 Feb 2019 20:58:35 -0800 (PST) Received: from localhost.localdomain ([116.75.87.120]) by smtp.gmail.com with ESMTPSA id t12sm44238958pgq.68.2019.02.19.20.58.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 20:58:34 -0800 (PST) From: Vaishali Thakkar To: andy.gross@linaro.org Cc: david.brown@linaro.org, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org, Vaishali Thakkar Subject: [PATCH v2 3/5] soc: qcom: socinfo: Expose custom attributes Date: Wed, 20 Feb 2019 10:28:29 +0530 Message-Id: <20190220045829.6852-1-vaishali.thakkar@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Qualcomm socinfo provides a number of additional attributes, add these to the socinfo driver and expose them via debugfs functionality. Signed-off-by: Vaishali Thakkar --- Changes since v1: - Remove unnecessary debugfs dir creation check - Align ifdefs to left - Fix function signatures for debugfs init/exit --- drivers/soc/qcom/socinfo.c | 198 +++++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) -- 2.17.1 diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c index 02078049fac7..5f4bef216ae1 100644 --- a/drivers/soc/qcom/socinfo.c +++ b/drivers/soc/qcom/socinfo.c @@ -4,6 +4,7 @@ * Copyright (c) 2017-2019, Linaro Ltd. */ +#include #include #include #include @@ -29,6 +30,28 @@ */ #define SMEM_HW_SW_BUILD_ID 137 +#ifdef CONFIG_DEBUG_FS +/* pmic model info */ +static const char *const pmic_model[] = { + [0] = "Unknown PMIC model", + [9] = "PM8994", + [11] = "PM8916", + [13] = "PM8058", + [14] = "PM8028", + [15] = "PM8901", + [16] = "PM8027", + [17] = "ISL9519", + [18] = "PM8921", + [19] = "PM8018", + [20] = "PM8015", + [21] = "PM8014", + [22] = "PM8821", + [23] = "PM8038", + [24] = "PM8922", + [25] = "PM8917", +}; +#endif /* CONFIG_DEBUG_FS */ + /* Socinfo SMEM item structure */ struct socinfo { __le32 fmt; @@ -70,6 +93,10 @@ struct socinfo { struct qcom_socinfo { struct soc_device *soc_dev; struct soc_device_attribute attr; +#ifdef CONFIG_DEBUG_FS + struct dentry *dbg_root; +#endif /* CONFIG_DEBUG_FS */ + struct socinfo *socinfo; }; struct soc_of_id { @@ -133,6 +160,171 @@ static const char *socinfo_machine(struct device *dev, unsigned int id) return NULL; } +#ifdef CONFIG_DEBUG_FS + +#define UINT_SHOW(name, attr) \ +static int qcom_show_##name(struct seq_file *seq, void *p) \ +{ \ + struct socinfo *socinfo = seq->private; \ + seq_printf(seq, "%u\n", le32_to_cpu(socinfo->attr)); \ + return 0; \ +} \ +static int qcom_open_##name(struct inode *inode, struct file *file) \ +{ \ + return single_open(file, qcom_show_##name, inode->i_private); \ +} \ + \ +static const struct file_operations qcom_ ##name## _ops = { \ + .open = qcom_open_##name, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release, \ +} + +#define DEBUGFS_UINT_ADD(name) \ + debugfs_create_file(__stringify(name), 0400, \ + qcom_socinfo->dbg_root, \ + qcom_socinfo->socinfo, &qcom_ ##name## _ops) + +#define HEX_SHOW(name, attr) \ +static int qcom_show_##name(struct seq_file *seq, void *p) \ +{ \ + struct socinfo *socinfo = seq->private; \ + seq_printf(seq, "0x%x\n", le32_to_cpu(socinfo->attr)); \ + return 0; \ +} \ +static int qcom_open_##name(struct inode *inode, struct file *file) \ +{ \ + return single_open(file, qcom_show_##name, inode->i_private); \ +} \ + \ +static const struct file_operations qcom_ ##name## _ops = { \ + .open = qcom_open_##name, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release, \ +} + +#define DEBUGFS_HEX_ADD(name) \ + debugfs_create_file(__stringify(name), 0400, \ + qcom_socinfo->dbg_root, \ + qcom_socinfo->socinfo, &qcom_ ##name## _ops) + + +#define QCOM_OPEN(name, _func) \ +static int qcom_open_##name(struct inode *inode, struct file *file) \ +{ \ + return single_open(file, _func, inode->i_private); \ +} \ + \ +static const struct file_operations qcom_ ##name## _ops = { \ + .open = qcom_open_##name, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release, \ +} + +#define DEBUGFS_ADD(name) \ + debugfs_create_file(__stringify(name), 0400, \ + qcom_socinfo->dbg_root, \ + qcom_socinfo->socinfo, &qcom_ ##name## _ops) + + +static int qcom_show_build_id(struct seq_file *seq, void *p) +{ + struct socinfo *socinfo = seq->private; + + seq_printf(seq, "%s\n", socinfo->build_id); + + return 0; +} + +static int qcom_show_accessory_chip(struct seq_file *seq, void *p) +{ + struct socinfo *socinfo = seq->private; + + seq_printf(seq, "%d\n", le32_to_cpu(socinfo->accessory_chip)); + + return 0; +} + +static int qcom_show_platform_subtype(struct seq_file *seq, void *p) +{ + struct socinfo *socinfo = seq->private; + int subtype = le32_to_cpu(socinfo->hw_plat_subtype); + + if (subtype < 0) + return -EINVAL; + + seq_printf(seq, "%u\n", subtype); + + return 0; +} + +static int qcom_show_pmic_model(struct seq_file *seq, void *p) +{ + struct socinfo *socinfo = seq->private; + int model = SOCINFO_MINOR(le32_to_cpu(socinfo->pmic_model)); + + if (model < 0) + return -EINVAL; + + seq_printf(seq, "%s\n", pmic_model[model]); + + return 0; +} + +static int qcom_show_pmic_die_revision(struct seq_file *seq, void *p) +{ + struct socinfo *socinfo = seq->private; + + seq_printf(seq, "%u.%u\n", + SOCINFO_MAJOR(le32_to_cpu(socinfo->pmic_die_rev)), + SOCINFO_MINOR(le32_to_cpu(socinfo->pmic_die_rev))); + + return 0; +} + +UINT_SHOW(raw_version, raw_ver); +UINT_SHOW(hardware_platform, hw_plat); +UINT_SHOW(platform_version, plat_ver); +UINT_SHOW(foundry_id, foundry_id); +HEX_SHOW(chip_family, chip_family); +HEX_SHOW(raw_device_family, raw_device_family); +HEX_SHOW(raw_device_number, raw_device_num); +QCOM_OPEN(build_id, qcom_show_build_id); +QCOM_OPEN(accessory_chip, qcom_show_accessory_chip); +QCOM_OPEN(pmic_model, qcom_show_pmic_model); +QCOM_OPEN(platform_subtype, qcom_show_platform_subtype); +QCOM_OPEN(pmic_die_revision, qcom_show_pmic_die_revision); + +static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo) +{ + qcom_socinfo->dbg_root = debugfs_create_dir("qcom_socinfo", NULL); + + DEBUGFS_UINT_ADD(raw_version); + DEBUGFS_UINT_ADD(hardware_platform); + DEBUGFS_UINT_ADD(platform_version); + DEBUGFS_UINT_ADD(foundry_id); + DEBUGFS_HEX_ADD(chip_family); + DEBUGFS_HEX_ADD(raw_device_family); + DEBUGFS_HEX_ADD(raw_device_number); + DEBUGFS_ADD(build_id); + DEBUGFS_ADD(accessory_chip); + DEBUGFS_ADD(pmic_model); + DEBUGFS_ADD(platform_subtype); + DEBUGFS_ADD(pmic_die_revision); +} + +static void socinfo_debugfs_exit(struct qcom_socinfo *qcom_socinfo) +{ + debugfs_remove_recursive(qcom_socinfo->dbg_root); +} +#else +static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo) { return 0; } +static void socinfo_debugfs_exit(struct qcom_socinfo *qcom_socinfo) { } +#endif /* CONFIG_DEBUG_FS */ + static int qcom_socinfo_probe(struct platform_device *pdev) { struct qcom_socinfo *qs; @@ -165,6 +357,10 @@ static int qcom_socinfo_probe(struct platform_device *pdev) if (IS_ERR(qs->soc_dev)) return PTR_ERR(qs->soc_dev); + qs->socinfo = info; + + socinfo_debugfs_init(qs); + /* Feed the soc specific unique data into entropy pool */ add_device_randomness(info, item_size); @@ -179,6 +375,8 @@ static int qcom_socinfo_remove(struct platform_device *pdev) soc_device_unregister(qs->soc_dev); + socinfo_debugfs_exit(qs); + return 0; } From patchwork Wed Feb 20 04:59:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 158760 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4491236jaa; Tue, 19 Feb 2019 20:59:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IaqwQKN355duEJzak0dDpqhf84g26XaBZmZLFaS/gK5XANW+T7klrwVZP4zxhLNmyidNszr X-Received: by 2002:a62:c42:: with SMTP id u63mr32492931pfi.73.1550638795698; Tue, 19 Feb 2019 20:59:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550638795; cv=none; d=google.com; s=arc-20160816; b=eXudZnK1vgAJm6rqr4VnPSxfMdvwmqE4Ch49F0n4/xoHGv71crzetuW5KxHXodI6u+ mI1jEMi4Bdk3cXJ9iOVompPKUSrnnjNB9DQyXbkGyamKGfDOxM3FdGKUR2i5VD+QX9EF wF7v+uVx9wAjVXR10/fJVM0zeMtOQjtEor+fj0JK2mHMD9TP5uXC0VS7ahqgmx4YzhnG x2T8yQmLk7Z7bV1KsVd37gYzUGmLBcgXOiZiRa01RWm14jRPevpqtI+td409PIyVwJtz c5InRomVyTMUKJtxt0mjNNIKB1ZaII2zmK1QlCgpzWixefAbhg+p9hLTMza/cHgxNJ+7 QQdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=GrPVf3f3smH6f7udVG/agaLjSqZZfKta/0GjZ4pIsL4=; b=BkU4xz1sdwV+ZT6iD9T4jTnDOQWtCALmHoEYj5IiXwfOif4MOLNft3xj3hYUPl/U/d sy17GDAVt7GOdgtP2gdurncSKwj981TBEF1Id+Vj+ZBo69SuOJJVziphNs5bVU5aUD3f zCRop2/iS3HI2CLgoc/CmiOLYjFbW+Fb2NcEpPkbOONxAQCMV/GGps9jgyUFRgNdjAM4 9Cg0SL8WfrXxHgALMwLvoYQIPivN6R5jc+cs7W3qYK/zr07EYbOyc0A139HSFKJ77Sq0 KP8MMTLvCr/sq6zhal/xUxRspAUs2RrGgI6VaUopDR+A+yn5UufGvLeryxYkxMcxqjGH 2aJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gjsInBN0; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si17221149pgd.256.2019.02.19.20.59.55; Tue, 19 Feb 2019 20:59:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gjsInBN0; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730505AbfBTE7y (ORCPT + 15 others); Tue, 19 Feb 2019 23:59:54 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40035 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730462AbfBTE7y (ORCPT ); Tue, 19 Feb 2019 23:59:54 -0500 Received: by mail-pg1-f195.google.com with SMTP id u9so7704643pgo.7 for ; Tue, 19 Feb 2019 20:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GrPVf3f3smH6f7udVG/agaLjSqZZfKta/0GjZ4pIsL4=; b=gjsInBN0fn0CvNWxvIVYgxypGFQ8kwrNgSwA1Kd+N6R0eCH5ZHGel9NNstoiLFibth uFuWY9eDqi3lKGa1xKUMTZGw4X5KLEyOjNIfnsWalGjsVwkUOQFAQM4YPDUsY55St3Z5 Sfs7TDP7TfAhnJvbM213qQtyZUm5KwQDwfvaBCnwS4ToEctNUNkeb3vWMjAM9c6PUYfs NgP++9lOh973WakRt8LUGHZtMdhQyvjkdvHg9bfVDIq1+C3uA/mp86PvfEHpj1fA9LDJ FncKo/1YJaKMtcmk+lKjeZQ9xct+88bQgDZsdhPxkFiA4siZM2FqRh8/7UG3c1O1qNId 7zvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GrPVf3f3smH6f7udVG/agaLjSqZZfKta/0GjZ4pIsL4=; b=SA2JSBY2vdhKG02mj25ltgzJf8rIfEmOWPzyPt0ZIYvT+/LhOS/OX7BzTm+oCyaA/M R1TWlOVl7jIE8StLFM+przKuzqTEqcOa4bkg7TwULi9wmE8c3oqqrBGxbq8580bWhtVj jKV4tVZOvROWrpTrHU6ZFLMdVFw3RvVrxtnOZ8uMAcGq1LvS74YCN65HYClZsWQRFfsY mZxbUPxZIYHrcfrMlwSyyxpOfcqNVSEixBhBz0vGPtJ6sfwkl/CaloR7O31fGU//12yi ydLjcfPkwFXep8UAJYzoEaD0Dx/Nbuj5BA0sXvs5TGTD7nvqrX6eATv6OGlcs87o5wOy sqpA== X-Gm-Message-State: AHQUAuYDMtVDsveyJeNLYwgDBDJW9Ae2zf8z6THIA3Warbpwwpj/BROl M7xhGyNrO6yCQNKmv7m1ks3fNw== X-Received: by 2002:aa7:8150:: with SMTP id d16mr10126710pfn.172.1550638794140; Tue, 19 Feb 2019 20:59:54 -0800 (PST) Received: from localhost.localdomain ([116.75.87.120]) by smtp.gmail.com with ESMTPSA id n72sm28493966pfg.13.2019.02.19.20.59.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 20:59:53 -0800 (PST) From: Vaishali Thakkar To: andy.gross@linaro.org Cc: david.brown@linaro.org, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org, Vaishali Thakkar Subject: [PATCH v2 5/5] base: soc: Export soc_device_register/unregister APIs Date: Wed, 20 Feb 2019 10:29:46 +0530 Message-Id: <20190220045946.7452-1-vaishali.thakkar@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Vinod Koul Qcom Socinfo driver can be built as a module, so export these two APIs. Signed-off-by: Vinod Koul Signed-off-by: Vaishali Thakkar --- Changes since v1: - None --- drivers/base/soc.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/base/soc.c b/drivers/base/soc.c index b0933b9fe67f..7c0c5ca5953d 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -164,6 +164,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr out1: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(soc_device_register); /* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */ void soc_device_unregister(struct soc_device *soc_dev) @@ -173,6 +174,7 @@ void soc_device_unregister(struct soc_device *soc_dev) device_unregister(&soc_dev->dev); early_soc_dev_attr = NULL; } +EXPORT_SYMBOL_GPL(soc_device_unregister); static int __init soc_bus_register(void) {