From patchwork Thu Mar 19 12:14:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 189924 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16485C4332E for ; Thu, 19 Mar 2020 12:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E223C20663 for ; Thu, 19 Mar 2020 12:14:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="njOQ4F8k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbgCSMO3 (ORCPT ); Thu, 19 Mar 2020 08:14:29 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43652 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbgCSMO3 (ORCPT ); Thu, 19 Mar 2020 08:14:29 -0400 Received: by mail-wr1-f68.google.com with SMTP id b2so2614013wrj.10 for ; Thu, 19 Mar 2020 05:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X2Xv4uORm87l+84uMG+Z6O9csFS6Z05eg8XvBedWYqw=; b=njOQ4F8kt/r3GjPvAzUyBYTgWq111kBIjNvQFumoP24lpirM/JRS32i7mCVLBAITCi cgiYylpSdPnpyFSwyawXbeFzc1KdwmAbCRNhWrvybOpBDtnQQiQK2bq/okxVMSP7NaCX 7bBvGtZ5YwrbK4yH7oOvieqdjMtx4erDTKjJyt/OzwZi131VLgkiU9Pa44pS1i3WJvFs vPGmnFXcmqDLGxd3OVVOQlNZWufB0Dks+OxA4p4z4tW/3yroj4QIdTPRJlx5QrWeFkAY g7cOh1gkk4K/rH1mndJ7M9wVr52N9ZqFiXrMm93At1zZlereR94Z0BjZFxeMRZqNgmU8 f0KA== 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:mime-version :content-transfer-encoding; bh=X2Xv4uORm87l+84uMG+Z6O9csFS6Z05eg8XvBedWYqw=; b=HoGszSpGyHlO2TVQDvSuSEImrq0iaO1Hw0tQE2LT4/EvfDxdsWHch6liYumaFSXllT OuA2CfYaf3k4Wkrdgs6mWoflT5AoeFdex1AiLR6NDxuALq4hOtwtKtQMJi/NJIZm03Ba ZopWVv1XgZWpw2PkD9U1P96rYfOnFO+2Ho7tcy5dgMO6Ma9vpkzFCGqRwv5Nh07U5P9L lafAk1Cu3f+6lOFbSCgEl6QamoXEwa2bmF98UNczl5Yyj5crXAbB76nD5g8VbLet3NVr oHCUtesChPDHbO59YmDK/HBNpareAfu6LD6bz50bD9YunGmOCMU4Q+4bYNymt6Ufgq+y DAwQ== X-Gm-Message-State: ANhLgQ3hMZK2PyKJrR+k1rv42rlOdkYE4h6MTgBG/4myJo97gg3uJdbs tBaBbMOOIL2ZpFFWUEnBfQvFcg== X-Google-Smtp-Source: ADFU+vtRmac6JqvgKSJgSidNRtitLeNCe4QcW4CA86WQGWpD3QSiU9DNPQqam6jsn2srAoi7DF6rEg== X-Received: by 2002:adf:ef92:: with SMTP id d18mr3813859wro.193.1584620066954; Thu, 19 Mar 2020 05:14:26 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id a73sm2770455wme.47.2020.03.19.05.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 05:14:25 -0700 (PDT) From: Srinivas Kandagatla To: bjorn.andersson@linaro.org, agross@kernel.org Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2] soc: qcom: socinfo: add missing soc_id sysfs entry Date: Thu, 19 Mar 2020 12:14:18 +0000 Message-Id: <20200319121418.5180-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Looks like SoC ID is not exported to sysfs for some reason. This patch adds it! This is mostly used by userspace libraries like Snapdragon Neural Processing Engine (SNPE) SDK for checking supported SoC info. Signed-off-by: Srinivas Kandagatla --- Changes since v1: - expanded SNPE short form for more clarity drivers/soc/qcom/socinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c index ebb49aee179b..08a4b8ae1764 100644 --- a/drivers/soc/qcom/socinfo.c +++ b/drivers/soc/qcom/socinfo.c @@ -430,6 +430,8 @@ static int qcom_socinfo_probe(struct platform_device *pdev) qs->attr.family = "Snapdragon"; qs->attr.machine = socinfo_machine(&pdev->dev, le32_to_cpu(info->id)); + qs->attr.soc_id = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u", + 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)));