Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp890175rwi; Wed, 19 Oct 2022 04:22:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lZoe4o+hsZ0YgzYMo8yynzNDaq1E8UYkteILw3DBGepaBb9aSTBRimFFE/FrUcKsAyRlU X-Received: by 2002:a17:902:f710:b0:178:a692:b1f7 with SMTP id h16-20020a170902f71000b00178a692b1f7mr8191839plo.112.1666178535544; Wed, 19 Oct 2022 04:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178535; cv=none; d=google.com; s=arc-20160816; b=loqZWCnSwgMa6jhXnoSyZLGihhqn5W0ZzI5oCTotd8nCi/7nOhcXw26BC+cISlRcHK UyMFQAtEXeSGwJ/G0fntKVB+qqA2//MCZl4yqcaWp7rfYnJlbSdJoMAZk6hqBNuCJh5m cgnc1Uc5gEE5ky9Yn7iwWzo6kHyE8KhrRkLQ4rpa9gt/Q0D4BB27dhGb9wbFac1YcApn b/U4XRLcIeJEMUO5/HaTQqsIVBc+DOKfKycf2JL8cQooN8d1MeVKCasbqwNMJUK0Xc1H Ez23P2UjUlR3rt6HlJAoaZ7EeEpDZLS+iHUu95pXWh/gW94nx7lbhVbBgZIJNwt/07Po TRcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2MAEoHH6W1OVf/XG1TWO/OngIIi9aLMr3pc7Y+hGwYQ=; b=cexvrts2Wdga/GzkiBB7bsoL4NRsk0fd9Cl5qqJkcg0O2IWZuepiHqN3n6404oE6zW vl66ylPWx1/7Ju8N0tc1/Op/Q9bWLMorw2MGMM39CrEr+mL1hIbTKFd7ZBhlaflWgoBY 04mNGJhLCddm9ITl2ThZ8SQkfcv02GzrjwzWQhvRD0/H4MuAY4wlAmMVvwEzhmOVgbsA EOcKuEEI6WFO9dWn1n97d8t9+dA+Sbg1XqKHkZeTrQXTHSlk3bSGSWzehVDk+O+wFYsl wUgDxNRCUgmTlmvVVErRoLAMKaC/m/c7y188YfOVaj3ITBwHYt7CUczOeteZf5fgLgi1 BPkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vMJY1SKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z21-20020aa78895000000b0056353f0bd40si18527613pfe.29.2022.10.19.04.22.02; Wed, 19 Oct 2022 04:22:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vMJY1SKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiJSLKP (ORCPT + 99 others); Wed, 19 Oct 2022 07:10:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234639AbiJSLJG (ORCPT ); Wed, 19 Oct 2022 07:09:06 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCE1717FD72; Wed, 19 Oct 2022 03:37:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 674B5CE21A8; Wed, 19 Oct 2022 09:10:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61F0FC433D7; Wed, 19 Oct 2022 09:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170626; bh=6I0oFww5l0V1IzzU+8y7drAJe30wzaT6tIKTcnOoUOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vMJY1SKNMNuAJiDTIVqV2YD7QwVYKTx1FT9qN711DSLfEDw3+PigTrmzQVg92UrNT p5vb5dpVJU2xPJwMLQi0qe87RQTKEOHDFodtZz1d1OmUVcJGdePC8OwmvC6Oc8JLPV yX1pr2vE/UYTvihhuTbR7Q9iyWxHG58vej7k8Y9w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Jarkko Nikula , Wolfram Sang , Sasha Levin Subject: [PATCH 6.0 726/862] i2c: designware-pci: Group AMD NAVI quirk parts together Date: Wed, 19 Oct 2022 10:33:33 +0200 Message-Id: <20221019083322.017596727@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 65769162ae4b7f2d82e54998be446226b05fcd8f ] The code is ogranized in a way that all related parts to the certain platform quirk go together. This is not the case for AMD NAVI. Shuffle code to make it happen. While at it, drop the frequency definition and use hard coded value as it's done for other platforms and add a comment to the PCI ID list. Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-designware-pcidrv.c | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 608e61209455..ca368482b246 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -27,7 +27,6 @@ #include "i2c-ccgx-ucsi.h" #define DRIVER_NAME "i2c-designware-pci" -#define AMD_CLK_RATE_HZ 100000 enum dw_pci_ctl_id_t { medfield, @@ -100,11 +99,6 @@ static u32 mfld_get_clk_rate_khz(struct dw_i2c_dev *dev) return 25000; } -static u32 navi_amd_get_clk_rate_khz(struct dw_i2c_dev *dev) -{ - return AMD_CLK_RATE_HZ; -} - static int mfld_setup(struct pci_dev *pdev, struct dw_pci_controller *c) { struct dw_i2c_dev *dev = dev_get_drvdata(&pdev->dev); @@ -126,15 +120,6 @@ static int mfld_setup(struct pci_dev *pdev, struct dw_pci_controller *c) return -ENODEV; } -static int navi_amd_setup(struct pci_dev *pdev, struct dw_pci_controller *c) -{ - struct dw_i2c_dev *dev = dev_get_drvdata(&pdev->dev); - - dev->flags |= MODEL_AMD_NAVI_GPU; - dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ; - return 0; -} - static int mrfld_setup(struct pci_dev *pdev, struct dw_pci_controller *c) { /* @@ -159,6 +144,20 @@ static u32 ehl_get_clk_rate_khz(struct dw_i2c_dev *dev) return 100000; } +static u32 navi_amd_get_clk_rate_khz(struct dw_i2c_dev *dev) +{ + return 100000; +} + +static int navi_amd_setup(struct pci_dev *pdev, struct dw_pci_controller *c) +{ + struct dw_i2c_dev *dev = dev_get_drvdata(&pdev->dev); + + dev->flags |= MODEL_AMD_NAVI_GPU; + dev->timings.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ; + return 0; +} + static struct dw_pci_controller dw_pci_controllers[] = { [medfield] = { .bus_num = -1, @@ -389,6 +388,7 @@ static const struct pci_device_id i2_designware_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x4bbe), elkhartlake }, { PCI_VDEVICE(INTEL, 0x4bbf), elkhartlake }, { PCI_VDEVICE(INTEL, 0x4bc0), elkhartlake }, + /* AMD NAVI */ { PCI_VDEVICE(ATI, 0x7314), navi_amd }, { PCI_VDEVICE(ATI, 0x73a4), navi_amd }, { PCI_VDEVICE(ATI, 0x73e4), navi_amd }, -- 2.35.1