From patchwork Thu Apr 4 05:09:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 10884941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBE7217E0 for ; Thu, 4 Apr 2019 05:10:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8E52289BE for ; Thu, 4 Apr 2019 05:10:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D3EE28A21; Thu, 4 Apr 2019 05:10:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50659289BE for ; Thu, 4 Apr 2019 05:10:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbfDDFKR (ORCPT ); Thu, 4 Apr 2019 01:10:17 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39708 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726894AbfDDFKR (ORCPT ); Thu, 4 Apr 2019 01:10:17 -0400 Received: by mail-pf1-f194.google.com with SMTP id i17so733019pfo.6 for ; Wed, 03 Apr 2019 22:10:16 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=mdOJYDtANreHncbeef90zrWtNG5DJsKAdH3zS7ujZ1U=; b=I3r7GRr+snPvFd86Mi8jhruOQUNWmdQmm7b7ecIcS4EHj+oanQWssoHtBXIkn+SnYs 0w73rCjZadVrqKxbWQAnB/YE8hVEXIEYZBybv5CJ+9iP5+xbfx4F/G5Yih5yIEJhu+uQ twbx3KiZqUOw30D/xSZ/Ry7bQwQ6y72jCZZ/2NCipPOAbkr1JOr0Bazn0lybvp5H34aZ T0XlScQ5jVShxh+p6UdaUhudPIJ9nIIwGOMd7HYJOpIsZCmzxD3yQY63DukRrvyplI5X mJev8i1yZg9q2PAox8OImn78RPANFXIEPBDJp4pi3QvnN1s9nChyPuxt6We/gHlQoKO5 U7Sg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=mdOJYDtANreHncbeef90zrWtNG5DJsKAdH3zS7ujZ1U=; b=M1M100H7/fkULXLN7j6xnebKgQbnpHug6Ru7icWDTfteFOlifmacDvFhfX7XAkzQuh OhkDRiug5g08kk7buvsPQdIVLWrU66bRfSQymhO2YCGJqoRKOXFpg+fByeeH45mwQhlx ShbiM+5YE1Hasj7GJdVAKvUeV5TXSX2CTwOPZ10S6b5doGXyWBV1uVw51aONfE8SdG7D aT0YqzMKsCnjmgRWIAEbdxXDVCfGKQ8+4AigYhjVBl++3x3f9VGOt00/l5PVZckx8udj uugLW+9sC32QV/2lKBF9wdvIoJdgnzuZgRqq4CYT7+qiRQXGdv+LJx0zwa0UijK1ix+s iqJg== X-Gm-Message-State: APjAAAU95QtXYBOY4ZMs3Ok4rBS9anakZchr5/9jayPy5FP2euKna5pK iC0X15/a3EVcRtyjuR/KguUFRw== X-Google-Smtp-Source: APXvYqzSg8jZaNaCln033SSe+y7aDDYAn05/YD7lzAIk2Vgdae5LzuQ4Ulyeb1lj8Cv2p315ZsreRg== X-Received: by 2002:a63:6fcd:: with SMTP id k196mr3772020pgc.238.1554354616065; Wed, 03 Apr 2019 22:10:16 -0700 (PDT) Received: from centauri.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id q80sm27623011pfa.66.2019.04.03.22.10.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 22:10:15 -0700 (PDT) From: Niklas Cassel To: Andy Gross , David Brown , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-arm-msm@vger.kernel.org, jorge.ramirez-ortiz@linaro.org, Niklas Cassel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 4/9] cpufreq: qcom: support qcs404 on nvmem driver Date: Thu, 4 Apr 2019 07:09:25 +0200 Message-Id: <20190404050931.9812-5-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190404050931.9812-1-niklas.cassel@linaro.org> References: <20190404050931.9812-1-niklas.cassel@linaro.org> 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Jorge Ramirez-Ortiz Signed-off-by: Jorge Ramirez-Ortiz Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 366c65a7132a..7fdc38218390 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,13 @@ static enum _msm8996_version qcom_cpufreq_get_msm_id(void) return version; } +static int qcom_cpufreq_qcs404_name_version(struct device *cpu_dev, + struct nvmem_cell *speedbin_nvmem, + struct qcom_cpufreq_drv *drv) +{ + return 0; +} + static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev, struct nvmem_cell *speedbin_nvmem, struct qcom_cpufreq_drv *drv) @@ -191,6 +199,14 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) dev_err(cpu_dev, "Failed to set supported hardware\n"); goto free_opp; } + + ret = dev_pm_domain_attach(cpu_dev, false); + if (ret) { + if (ret == -EPROBE_DEFER) + goto free_opp; + dev_err(cpu_dev, "Could not attach to pm_domain: %d\n", + ret); + } } cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1, @@ -247,6 +263,8 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { .data = qcom_cpufreq_kryo_name_version }, { .compatible = "qcom,msm8996", .data = qcom_cpufreq_kryo_name_version }, + { .compatible = "qcom,qcs404", + .data = qcom_cpufreq_qcs404_name_version }, {}, };