From patchwork Mon Sep 23 08:03:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830390 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19598328B6 for ; Mon, 23 Sep 2024 08:05:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078737; cv=fail; b=BLo/LsK5FpsyAZfQXGhKSA1GZNNhIEEreAlajT23ir4PCRtzV2cVyFr43pNqKurKhHqb/v2s6vEwoO4qkXtrfus/nlXaGQJ1sg2R3ATbqkyGgsMFjUkD2qf7DW9HiOoPU5P1BkzO+uEPl2zx8vpZVT2o//csmpfzgsvDSwRTaQ4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078737; c=relaxed/simple; bh=EbHAnuaRVhQTeqGa+PT8hC3LlZ9yqJfIeqM5E/IIP4Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bsZL/R9W7PLX/o2fBH7dqTSAjqCQ3/kLYInXoU2TVP7t2ve6dh47h4XIPrfJcxkO4scaGHCnkVJTwybrzGudeT7jvXokuwShlCiY8x9h7+gx0mzjq3kErneaaeer6QAFDm3Cu80O237mIMizE/EOyFC1rDH19V+87GHWR3hItIE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=LGdyfYGJ; arc=fail smtp.client-ip=40.107.93.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="LGdyfYGJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yxU8o5SqEG5+MbQgeEKITbIs60hu2p1+RdIR9nl58dtIllHYCaeydzLsYlHgTXuRTkaIfuYihL1Uim3dul5GHtIeh3sPQNCTkjfvUGwwGOQDw2Q2BAOvPYYPzUaspMP1ZFkADnTZI80uZN7yTK38/A1fh9rFxLv/nCJ36EC1Q3p0TDkfslzfjuS+RhKI75HBLUyj6epFHgQ2I/3OogIHUdd82cfE+7wtzR1OshZ0pgvrq+w+/cXhwSlqDO0K3M4rpatNmN/1eSgcXa+3QJwBFEYPzoZWvNaMPQ2jxd3kyoh0YA234iFoP6+T0aD0oesTArAquR5teds+/xdI+8Yt3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pv//g30l8p1auD1afNh1AfRALQVgbYB16xHyAlfPbBs=; b=bWWDrXbUl27hifSmAwxUQ/9mFqJyHg9zheBTzHB4qsaJXB9q7BQkBgxVrOstw7wCZnYlUggN5jgnJ0jyWJCtgGNjVCiUBN5QqiHK6N7zcRwWWIMUAKn6+geD+KYWTaeRGI7evpK06/zKO0D92pWKPQIMIYFsVp5SBu8GFqOGwWzrszJxXau2k/KDggcE7BK+AA1ODQHZKrBgKyx6c6TqUI48fkuGM6H5K0TctD1ok3nrKCdwtPh2HtyLtmAqoJIDyWX3lSqr3I3+lZgWM9c3+4IMDcImUFEfXdYhpethOGhZtt9o1FpuhgcZT1rXO2b+DOVofgb3RmGJ3oQXfpXQmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pv//g30l8p1auD1afNh1AfRALQVgbYB16xHyAlfPbBs=; b=LGdyfYGJdbkqiiAs5ukZvb5eKaubq7VEnT+Xmc65BSRdCOY7pAK7OOgElyUv4doi+8X2GxN4+msV3/wGXGyvdqrP0FMCQb1Fp3hEvZghg2qcGcjxNGAUZRptKkKa5d/COEFp214eHb58TqsStROHq8Bkujuxb8ykbOpsNONiXsE= Received: from SJ0PR03CA0366.namprd03.prod.outlook.com (2603:10b6:a03:3a1::11) by SN7PR12MB7369.namprd12.prod.outlook.com (2603:10b6:806:298::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:23 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::72) by SJ0PR03CA0366.outlook.office365.com (2603:10b6:a03:3a1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30 via Frontend Transport; Mon, 23 Sep 2024 08:05:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:23 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:20 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 1/8] i2c: piix4: Change the parameter list of piix4_transaction function Date: Mon, 23 Sep 2024 13:33:54 +0530 Message-ID: <20240923080401.2167310-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|SN7PR12MB7369:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d330523-238d-4e8d-83ae-08dcdba679d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: /xfwgcz6yhJOCF+YsEXQo3wPJXoI5STReZXwES4Yx+QvrTCPQgGrzvddDf3jJ0TH/Wuhn6ceckhSarwCUQOPgBid70nkLdJHZtW7pYibxYn89g+HxuQLgVLtpphC45QbsC1OOpuCbM524Ssa5teeBYhlW0arwJ7WqOu+kcElGlv2QE6pvaAQNyqIz6kIUmYhve56JrTpn76VS32SKVX4FLgwGFPMydAFeUV7y+OzBuR+FGE5oD3ukWsmv6T2RhHYwegZr3nRBxR7dLcfBXTVpaK6ORinvaZvEmJSlypHZTfirWnO7XnuXarG5luJyoNfiNF+nqWpIqhQr6XKc+mzGvotp5A+bCd9cgrnOcC2W52nCQRRRzsTxWDQww6MTQOAfC5+oMF4ioNN/EeQfJF4AAdRl+3w/jS73gzuHrMncPIkXDoZdkgcv6NY+A9/J1xMeV7qRVoIrfdz7Er4bdGHBNb+mQMuLvr0qDDA7aGkynOSHnGOqQiVZhwjkx17hO+RDTNA3azdmlm4mCT3PW3F/qEE2WOZNQV52vOWggsQkTqM3DYRCVb1O590JtvSjT02ZMNxBCrpsYlqOB+Qy3evHEX1a3p+27QyH1HrwuUQZ9DimozyZp/he4ZTM6Jovtl4LlCJ+7q2NEkl9fKCpD5k7gqWsJjSBYY4mCm27grq+YZjFdhov1tPmdoRCZvwfKaTG5CSXL3H43MnEsuWBPmjEksTWazppoj+/SdyoegRtWW+9IAzdlZOo+B+zzgAICIKlt6E9RqnHmcgX1c21x/4tGKpO+QeMIaqe8Tmu2F8hanCPNNE4SyAkf6IHE5Oy9vP7kUMZhj7wQlnI+sOmq3lXjeKtEipY4ftK/GgtFNLt1JCTKFvnrn09T7wMZL/CSpu2hoNV8Etp4JTWgbxceAOTtgv+ta2IWm2LXkSyyP1WqcXKq3WkuD7EoeQQHtZ1zqOxZJItXDMLvMzIzmRb1uMY5NhsWxaIFKYb4ciEfDgGXcZVxVh5Hv+CdztVozAZz/Wzm/DVjNQtI6D/bL1ewG11RRt5EfY6Vc+4RdEaMdn0k9k+BVDZ06/eyhzJ+5m6wy216Y7SQh7Gm87fwaw6cWeA4t1k3MuaY+zmTmjrtf7wgXMkZIXY/n+QrW4knSFPa/RxGD7k1mFFSdiaBM0+FGlxSaZ+inGX/9+xTJcKhMbezqyGElAXBArPRL3szXw9rOhXMmar6wnbiPcAqYIavNP3z9CwEOx/h2oSYGljAfgkFZDz590QNiKjCrEYmfMLN5dfkU64jf109/S9GtYo/NcbL226bAMg7QXK6I/jl5iokUrNQW8OA6GFwfWCP4buQC77YqIFYcoD4FLJa/hmw+m4NRY9wy2jz+qeuh3MB6nCBqh7r8JrvgsiYgfhxeclo204WcRCwX+IkROT3BGr5H6i05WRP6eUSaK2ALxz/ZwGbN8vOiisl5VqXxxjUbtBwYx X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:23.3648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d330523-238d-4e8d-83ae-08dcdba679d8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7369 Currently, `piix4_transaction()` accepts only one parameter, which is the `i2c_adapter` information. This approach works well as long as SB800 SMBus port accesses are confined to the piix4 driver. However, with the implementation of a separate ASF driver and the varying address spaces across drivers, it is necessary to change the function parameter list of `piix4_transaction()` to include the port address. This modification allows other drivers that use piix4 to pass the specific port details they need to operate on. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i2c/busses/i2c-piix4.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 4e32d57ae0bf..69b362db6d0c 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -536,10 +536,8 @@ static int piix4_setup_aux(struct pci_dev *PIIX4_dev, return piix4_smba; } -static int piix4_transaction(struct i2c_adapter *piix4_adapter) +static int piix4_transaction(struct i2c_adapter *piix4_adapter, unsigned short piix4_smba) { - struct i2c_piix4_adapdata *adapdata = i2c_get_adapdata(piix4_adapter); - unsigned short piix4_smba = adapdata->smba; int temp; int result = 0; int timeout = 0; @@ -675,7 +673,7 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr, outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT); - status = piix4_transaction(adap); + status = piix4_transaction(adap, piix4_smba); if (status) return status; From patchwork Mon Sep 23 08:03:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830273 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2071.outbound.protection.outlook.com [40.107.223.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA7A9374CB for ; Mon, 23 Sep 2024 08:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078738; cv=fail; b=hXQAz9XKmEFhy9qMjqnBW/UbIEt8hJCmvQlPmq7S4xEyn8cRUrFuhf71f1gqyfaRC5BEIPji0zTcrvAtL2SvCiWaOFruilRVBPJBr3i7a0Y3IPk+sioV1mbJzGnU/5IMs/yQzGGF3l/OK2Hav0IoNWAdXKaixj0K4S6+BVDUQgg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078738; c=relaxed/simple; bh=0np9Q4YMX9GidrQpmWyAccGDMdiDOgJ7V009nqq0PL0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t7QOgVwOCEToMlCnQ0XgFe5NVyF9k59l5WlDqVtfCGWEEmtiliH4mTHQk6OWzIayZI6dEXrdF4ZcwTgHEzQlpSqENwV1PmUKIx1xflvTp9RaLXQbwKyBeEzqW3PvYGQjMHE0K4KyBDbtz2jVAEBX+khQHhkIHUzsIznreSHPPik= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=XqZocTnd; arc=fail smtp.client-ip=40.107.223.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="XqZocTnd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SCSy5BYIDxKp/OcgmmWtvmIVCkNFpxT+Qt9JtcZk9mv5ilhGAHBHegakfU9u85a9PUNXVj3uCxPKW2uKftQlr5nZruG7+zSgaGcesISga0ohclO8lgcPJD3mMfsIvmwYm/8A+ELjqQeEe2FbfaHj/pt/tfoI3KiJ+xEOiQH/qZjizmXGOR7tt76JTkBQ10jPNWsXqP3CUSr2qihZA1ie2XSmt5IsUICoDYCzAAT/4muVsUT9gJ3qaTmdtxke/d5aEXU+8Ife2VXh/Tr69LuXvT6+zDcpbRNo1QMBSa/qBwbs5hGs10QpsjIVGMLZwSIJPedoRjntnF+tPYL13/ehww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6FQ58NbJQnHFYAtd+1lDyy+EpF5JHd3+o+0whg3I6zI=; b=wJ9saSz2MGEIn9ZBxXqfLj8B2RX21YgSFp32ZGDxYQ2MuWd+veYkyWVkZqBLcYpeClt4kBy//M7P1iwQuC19XBh7mMUQMvnmBcbnIgwBrkMxA4319P3rdfilFitY//kw69ODrKInLusDoU0tppRRLZZCotXkasTBRt1cV8TU0OcVXcxgfgQyuaR581PbBtiARdmJrJnThWhUKCStHp58lzq18ajV0kbA0COJokB/4+W11QNRljJ6Lbo1wOyLYjKYfy5R7oVoi/UPSuhoAU0hPOewWsk9KvOclHzS52etfMxvIXIp01284nxcOY1jT397s7SJ+vhK8dusFE6KPjHU3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6FQ58NbJQnHFYAtd+1lDyy+EpF5JHd3+o+0whg3I6zI=; b=XqZocTndUjeE69M2500evE6eQ3LLdAamqI0ATUQ7OKSgLv+4UxcsOJ3dzA0bv5IdJz+pwVce/SkGVtcr8be96cJuCSn8oszMJu52KBMUCc/MBfVJosxbBq+L6ZyP9GsDTolrUKTeoxj6MZws0vS3m3QE7gcAPRcgmN4grHi3s1w= Received: from SJ0PR03CA0376.namprd03.prod.outlook.com (2603:10b6:a03:3a1::21) by DS0PR12MB7851.namprd12.prod.outlook.com (2603:10b6:8:14a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:33 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::44) by SJ0PR03CA0376.outlook.office365.com (2603:10b6:a03:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.26 via Frontend Transport; Mon, 23 Sep 2024 08:05:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:33 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:22 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 2/8] i2c: piix4: Move i2c_piix4 macros and structures to common header Date: Mon, 23 Sep 2024 13:33:55 +0530 Message-ID: <20240923080401.2167310-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|DS0PR12MB7851:EE_ X-MS-Office365-Filtering-Correlation-Id: 22d1a12e-4695-40e4-6875-08dcdba67faf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: bkK4un69T4saHs9//Jlxm5cer9qHeK3okTdFV8uhpM8+/ocRhM3G59V+5WKixup+KH+IdKGViPJtqIF7xzF03ydhl3zsAFO3ANJcdeIdLrnOWiGT2TUJucOb5WMxrqWr4Bkf3c4zFVJBdJuhfDDbsVcPV49Nu082Vzsrr3rKFqGapeUecqbRmvrWCJ/DDgrJUBTn/BsxBz0nFvWATuw+OnKBTyj3AZonFqWjItDALJ0iwnxMAaITQ7otteaKXiSjfpxHJd/0I8JWYY/4KMR9Di20svlBdIEs1NRLDTVcjNp8Fa1nP7AafOZ5D1CMI+RW3WykpEUln1lCmp6a6+fbuSRrf2eNKycZgo9rlbUFhzs6lVbnYpK/+JmG1MtHfkgpN7tfYWPv7u9OeG8Ew4GuMBKk/hysCNhe6W8eewhP8da0uAzajcO0Ju2o4DlQOOx78EP61riMoUsLYz6xre4wSwOZV2IiHTVY6yZBaH6d2SmGoCl08XgkYugAK/r5/0dV4KjNYoCBnPsIv19POcjaso5zexEAdtFQOAS9HH1AsAN0eE/1hxEU10DTlW4/f5+SvblnarCYw5z7wUoJHImytPGs6FweN1vsSzqiJzh02RQsuarHwY5qB114E2f0WDLEqRJdw134XnvDWJ1a5MfPOLFtRWiYsGvzA0WwHVwyDwWx9j6eJ9LWSD/IX3rhNJFemAnYX7xpIlLpXzbuwK33h6qK245bsUnui5kBYtgOQLtMmPVcXLRkfKmYY0B0LY1jnNBj3gdGWpINAJpWFjPkPlxAf2tJUmog5Sf+8M96YD3MmtCDMMbszGZ9AUzQnl5dunJrr3XOb7LTJ4RA2wBcYWf2sf9GLNP/OqNlWvINzQNfdLg3k09BtUQ10WKiWnac8+u2eTTxkQpb/LUCpikLU0pyIuRJSJg5Q/KPgQsSSvcc3UmIKTgPlPWYpwE2ssV06lBR5D5zxDqCTLfvGodhQ5ZWgnUFXVekVOltT7vD9VZtzQKxn713GVBplLHTQli7eYJH85+i8/s3Fwlz+tcv0UAH/1nlX1ng73FuEKJ0Zf3V9809N0YKNY1EDdU+DaBAA19XyubHH150czm1xazW0KNqfZkvkNayLUmUcPW+mqIz7UaWR/wjn6aVt7LDHTt1/ikWP3rCMGT4NJWi+wmS3mw5rfiTyHrA9/8y/0Qlh/BgubBk4B1QNsrmyP22RJj6CaqWOs3d68kT+nECZPh+5BunkxNJ7akHMlLRH5HtNY959AmJCkCJ191WbbT64SmqezznaW9IFgFm9+0qZ5JAl8/HZzy9v5nM7z4psziDpmdq5ib0laCaBPUhbh9nVT75XGOWIfuUrjafdPD1/w8uBLt9Sy/nr8Ym+ovupCIBWpfYrjXAvypgCdYeAxL/7nzp X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:33.1617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22d1a12e-4695-40e4-6875-08dcdba67faf X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7851 Add a separate header file to relocate the common code from the i2c_piix4 driver, allowing the AMD ASF driver to utilize the same code. Update the MAINTAINERS file to include information about the new common header file. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- MAINTAINERS | 2 +- drivers/i2c/busses/i2c-piix4.c | 21 +----------------- drivers/i2c/busses/i2c-piix4.h | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 drivers/i2c/busses/i2c-piix4.h diff --git a/MAINTAINERS b/MAINTAINERS index 7387afe8f7ea..e1765d39ae75 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10687,7 +10687,7 @@ F: drivers/i2c/busses/i2c-i801.c F: drivers/i2c/busses/i2c-isch.c F: drivers/i2c/busses/i2c-nforce2-s4985.c F: drivers/i2c/busses/i2c-nforce2.c -F: drivers/i2c/busses/i2c-piix4.c +F: drivers/i2c/busses/i2c-piix4.* F: drivers/i2c/busses/i2c-sis5595.c F: drivers/i2c/busses/i2c-sis630.c F: drivers/i2c/busses/i2c-sis96x.c diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 69b362db6d0c..4f070863a2cc 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -35,20 +35,7 @@ #include #include - -/* PIIX4 SMBus address offsets */ -#define SMBHSTSTS (0 + piix4_smba) -#define SMBHSLVSTS (1 + piix4_smba) -#define SMBHSTCNT (2 + piix4_smba) -#define SMBHSTCMD (3 + piix4_smba) -#define SMBHSTADD (4 + piix4_smba) -#define SMBHSTDAT0 (5 + piix4_smba) -#define SMBHSTDAT1 (6 + piix4_smba) -#define SMBBLKDAT (7 + piix4_smba) -#define SMBSLVCNT (8 + piix4_smba) -#define SMBSHDWCMD (9 + piix4_smba) -#define SMBSLVEVT (0xA + piix4_smba) -#define SMBSLVDAT (0xC + piix4_smba) +#include "i2c-piix4.h" /* count for request_region */ #define SMBIOSIZE 9 @@ -70,7 +57,6 @@ #define PIIX4_BYTE 0x04 #define PIIX4_BYTE_DATA 0x08 #define PIIX4_WORD_DATA 0x0C -#define PIIX4_BLOCK_DATA 0x14 /* Multi-port constants */ #define PIIX4_MAX_ADAPTERS 4 @@ -160,11 +146,6 @@ static const char *piix4_main_port_names_sb800[PIIX4_MAX_ADAPTERS] = { }; static const char *piix4_aux_port_name_sb800 = " port 1"; -struct sb800_mmio_cfg { - void __iomem *addr; - bool use_mmio; -}; - struct i2c_piix4_adapdata { unsigned short smba; diff --git a/drivers/i2c/busses/i2c-piix4.h b/drivers/i2c/busses/i2c-piix4.h new file mode 100644 index 000000000000..32da914109ba --- /dev/null +++ b/drivers/i2c/busses/i2c-piix4.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * PIIX4/SB800 SMBus Interfaces + * + * Copyright (c) 2024, Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Authors: Shyam Sundar S K + * Sanket Goswami + */ + +#ifndef I2C_PIIX4_H +#define I2C_PIIX4_H + +#include + +/* PIIX4 SMBus address offsets */ +#define SMBHSTSTS (0x00 + piix4_smba) +#define SMBHSLVSTS (0x01 + piix4_smba) +#define SMBHSTCNT (0x02 + piix4_smba) +#define SMBHSTCMD (0x03 + piix4_smba) +#define SMBHSTADD (0x04 + piix4_smba) +#define SMBHSTDAT0 (0x05 + piix4_smba) +#define SMBHSTDAT1 (0x06 + piix4_smba) +#define SMBBLKDAT (0x07 + piix4_smba) +#define SMBSLVCNT (0x08 + piix4_smba) +#define SMBSHDWCMD (0x09 + piix4_smba) +#define SMBSLVEVT (0x0A + piix4_smba) +#define SMBSLVDAT (0x0C + piix4_smba) + +/* PIIX4 constants */ +#define PIIX4_BLOCK_DATA 0x14 + +struct sb800_mmio_cfg { + void __iomem *addr; + bool use_mmio; +}; + +#endif /* I2C_PIIX4_H */ From patchwork Mon Sep 23 08:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830271 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2041.outbound.protection.outlook.com [40.107.95.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3D083C485 for ; Mon, 23 Sep 2024 08:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078743; cv=fail; b=Q62ci8+bhrewV9/Sh3PBHMl9rsF8/ZMyQ/f4lVjyiBvqj4ItKb+VyJGEg7DLVDbZmx//C2UYWWB2xnOOaujpAEuSAbXQSpj5fVKGfWJXJlhVYE6rFeYIemol03VK+FgDG4JS+Bz/10mjITC2vvUuSAwdSm0tS0rCAMunzPhYoLA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078743; c=relaxed/simple; bh=pSx2mcnBADHmOElkL8YFEg3dmmDMiDqdwyTH8qFgopM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DONo8vlhEZDYtHZ1lrXCNwN8tfeht761HTSfdSVkp3QNSaJgccaIsreP8/1GcrAvQwPdPdgiiu58Z2muDhD2FFTVve9EF2A376AQ9rXA/p21FwBjsQ8Dd1eEXt9fLn4zM7K/s8UteT9IxOsRitZ1wy/GpN2ArEt7xSvSATciy+4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=I1uSyEEj; arc=fail smtp.client-ip=40.107.95.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="I1uSyEEj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xoj91gAbUAjyJSOWccP39iJvWKzfY2HEhjCp+tN4zdZXf3nOrSukQROaz/dnh1y9UW03kqytTgziyRzWGej9zwNMyLXjm0Bjof/Xaq/RFJR6y5hJDWSdMI2hO6Lh84/oxDbjqQpxyUyq+kXsDD3gqIU/N190B9hILVLwX8kavmFkzwQQCy3HV4zDUHTwdcKKO6hSWHZSU7S3+gZTFPREIXUlEZtzBHJY3nclqQESRtfjENFWpbnR6sEaDBsT0SuFjLX1fuPAeWKKF/OBsFsP0naeNd2akJqXqL8BKUbvBsU7ViWux/Jb1zOMHIXp60TeO/5RLsXLOTM5PwiBdHafrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WN9v5KIfIIBpwZbyFCB/2EIg7x+vcV5P4609Y+O8vps=; b=xLsyQi61Pyvi9cYf7PFUUjQr8pUzxnAqnlYzTr8gHFZ1QLRVrnkoB8sDfdatSWYuNeOVsGVoM09OxPTrVfPM7xjjDpGQZzz+Bj8xC/fpzT/YIocYVn9nE4wCjpmKQ+2bv95eqfp7OlRbCXf0i3nE7dNazGEll5ktCDvAoiBtrrAgKYFo0LpEWLLyNHIl4BjNk+q1WucSvk4mi7o1UyHXb0MaDRjayHW95utmXD8EaOvkySQ807bKnN9yN4xeoS7nr/xBhpdmkhefvAaCUu/HiN7i4fFujobsKVF3dUSM20ObS9qjmU0bcSWwhJrDr2IdpYDpDEwu0EbTS5vHL3MX0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WN9v5KIfIIBpwZbyFCB/2EIg7x+vcV5P4609Y+O8vps=; b=I1uSyEEj7zNrlUDbJaDBozbrbwlk5AXIvlKXwIeeLHvKdz6Qq4I/wrcYTYQNN8VhfmUH/CvyRia0g80Y7uU8kn5tmHvyZgGDGmqAVTNwxmBb/oAfO/RiVKVJ9cigAkUFtneyky+irzqBrch+ngn+sHyWymJG9x7cBswFLOlzQyo= Received: from SJ0PR03CA0363.namprd03.prod.outlook.com (2603:10b6:a03:3a1::8) by SA3PR12MB7858.namprd12.prod.outlook.com (2603:10b6:806:306::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:34 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::de) by SJ0PR03CA0363.outlook.office365.com (2603:10b6:a03:3a1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.31 via Frontend Transport; Mon, 23 Sep 2024 08:05:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:34 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:25 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 3/8] i2c: piix4: Export i2c_piix4 driver functions as library Date: Mon, 23 Sep 2024 13:33:56 +0530 Message-ID: <20240923080401.2167310-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|SA3PR12MB7858:EE_ X-MS-Office365-Filtering-Correlation-Id: 6640fd4a-fae4-43d6-b12f-08dcdba68039 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: 6ySROatIk9jAFBZb+J1ieiE+mGs8G7G5uH0Yl40uGbkXPeULoWb/Ta+ySfcbUozavisoB6RWeEap47ZAegLIqxlLd44sF7o6Amt4pvhOjYDYVtkHzMsNgL6C+XYBX3vCPe0z8SRnpBI2qA23Bv+GhX1QSiPmYC2SRZbLOisKVNJ+AKXADcpr4wDNs6Tg1GWPv683AbObTRjYsBD8vEcfp0qkIrN+Swi37qlrhTnEo5DQT0YXIMmRciJ01S9Mmhic1j1ye10mU6NaD6J0zVxvKj5DcJHX7yIKkbjDt8/CHQ1ehFDUKQqJDkKShsMC4jqphcpQQKNNcrTf9dCaEEh3SvuSY8XJt61eHqCwNzmqL/k7lnHU7AdIvUt6wrIm4+nZ/sOt4K+aV0lGj+rShVaVFGwFJ53N7KkH7+f7mMKLIjmZdyBe3kHNAW16RAWK7Wv1Ubna6c48JjEz1gjECIyva61CWcO5Aa1udkmlCAQXCQHs1p+HWZP0pyZdJX0rr2avDSTnug//Sovhkh85J1ksrMuFP2UnpE9aG6mPpxkG/hCHhoxYio29YVKqP9oZ7GLQBvrardoKdVpTEYmk8h6qnN7vRZVK7SXia6SOkjP4mf51pNm0oXMdAzP5D+mP4jgcapgGxKXoMDIYiPIJplqigcbCelCSQjHBXNf9s5l7srGVLGsy9cRnADUjieeZktR3X7fsUBZ4U4et4zJ9oklfI0cc3phJIcEtdl+MrusWVTvXuysOJacEnSQEdDQULAt0pU27QGKGSNmj1MkjXt1xEu/3woj1VXGp+O5k3tMtgXrADe0M1VkmyVTkgQ/3yMcTdAgaQU3xQJq3mtTraAjFaQ3VvjQs1SBWKOrdBXIbT9TojfhIg/aI87qGaLRoI2RUcqPDYD2+CQ+ykfVzgxVWPl/PhGfjjYkQVwZ4w2hIS/yzUtlOwexLzJ5HceS7VjbGOrYfff31vIhAASsXt4WG8At0g0xJ+CKq6/hy2Cn39N9CPS3uv9Ex4NqtqpHTwxjg6At7PYJfJiL8zT1uN1gD7ER6k5CvQDunUzFVRRpICU/KppaH+899x8gH7PmImqdE+jQ+qJ5saWerevd1aHf/k2eKLvQLkgDCGQ5tWacQbnEJRDdNpSv7qQrfpU8egGoIFfRMLOwhyNVuYP6j0eEEyVDTx3UMIZtdXpW2badwfMaL/ILKMrBIdXKGmpUaVAuuopMq4MwnsYda0YMqh99mJ2W6DDgnEElQN8d9JhczUIQVETodk6dn5TXVwk0O0P7aU48VPiKuSxWZtZS2dB8jhbIoNpBpv5TIXHutb+0JwUOI4qM/fVy6Fg7dAdYR69xQeQttBSbwUj9O4xKUpbWaEPPQCDXvcLV8KEqSi2V6dJHkww4ddPeADu2STTDK/2JQy56wHEcVDs5I4ohFOrAWP2zs6TSx6dWbXtcuQGEOlhoKL7rq2g0aDmwIKHfgQzuk X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:34.0680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6640fd4a-fae4-43d6-b12f-08dcdba68039 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7858 Export the following i2c_piix4 driver functions as a library so that the AMD ASF driver can utilize these core functionalities from the i2c_piix4 driver: - piix4_sb800_region_request(): Request access to a specific SMBus region on the SB800 chipset. - piix4_sb800_region_release(): Release the previously requested SMBus region on the SB800 chipset. - piix4_transaction(): Handle SMBus transactions between the SMBus controller and connected devices. - piix4_sb800_port_sel(): Select the appropriate SMBus port on the SB800 chipset. By making these functions available as a library, enable the AMD ASF driver to leverage the established mechanisms in the i2c_piix4 driver, promoting code reuse and consistency across different drivers. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i2c/busses/i2c-piix4.c | 14 ++++++++------ drivers/i2c/busses/i2c-piix4.h | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 4f070863a2cc..ee76ccc71697 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -156,8 +156,7 @@ struct i2c_piix4_adapdata { struct sb800_mmio_cfg mmio_cfg; }; -static int piix4_sb800_region_request(struct device *dev, - struct sb800_mmio_cfg *mmio_cfg) +int piix4_sb800_region_request(struct device *dev, struct sb800_mmio_cfg *mmio_cfg) { if (mmio_cfg->use_mmio) { void __iomem *addr; @@ -195,9 +194,9 @@ static int piix4_sb800_region_request(struct device *dev, return 0; } +EXPORT_SYMBOL_NS_GPL(piix4_sb800_region_request, PIIX4_SMBUS); -static void piix4_sb800_region_release(struct device *dev, - struct sb800_mmio_cfg *mmio_cfg) +void piix4_sb800_region_release(struct device *dev, struct sb800_mmio_cfg *mmio_cfg) { if (mmio_cfg->use_mmio) { iounmap(mmio_cfg->addr); @@ -208,6 +207,7 @@ static void piix4_sb800_region_release(struct device *dev, release_region(SB800_PIIX4_SMB_IDX, SB800_PIIX4_SMB_MAP_SIZE); } +EXPORT_SYMBOL_NS_GPL(piix4_sb800_region_release, PIIX4_SMBUS); static bool piix4_sb800_use_mmio(struct pci_dev *PIIX4_dev) { @@ -517,7 +517,7 @@ static int piix4_setup_aux(struct pci_dev *PIIX4_dev, return piix4_smba; } -static int piix4_transaction(struct i2c_adapter *piix4_adapter, unsigned short piix4_smba) +int piix4_transaction(struct i2c_adapter *piix4_adapter, unsigned short piix4_smba) { int temp; int result = 0; @@ -590,6 +590,7 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter, unsigned short p inb_p(SMBHSTDAT1)); return result; } +EXPORT_SYMBOL_NS_GPL(piix4_transaction, PIIX4_SMBUS); /* Return negative errno on error. */ static s32 piix4_access(struct i2c_adapter * adap, u16 addr, @@ -743,7 +744,7 @@ static void piix4_imc_wakeup(void) release_region(KERNCZ_IMC_IDX, 2); } -static int piix4_sb800_port_sel(u8 port, struct sb800_mmio_cfg *mmio_cfg) +int piix4_sb800_port_sel(u8 port, struct sb800_mmio_cfg *mmio_cfg) { u8 smba_en_lo, val; @@ -765,6 +766,7 @@ static int piix4_sb800_port_sel(u8 port, struct sb800_mmio_cfg *mmio_cfg) return (smba_en_lo & piix4_port_mask_sb800); } +EXPORT_SYMBOL_NS_GPL(piix4_sb800_port_sel, PIIX4_SMBUS); /* * Handles access to multiple SMBus ports on the SB800. diff --git a/drivers/i2c/busses/i2c-piix4.h b/drivers/i2c/busses/i2c-piix4.h index 32da914109ba..36bc6ce82a27 100644 --- a/drivers/i2c/busses/i2c-piix4.h +++ b/drivers/i2c/busses/i2c-piix4.h @@ -36,4 +36,9 @@ struct sb800_mmio_cfg { bool use_mmio; }; +int piix4_sb800_port_sel(u8 port, struct sb800_mmio_cfg *mmio_cfg); +int piix4_transaction(struct i2c_adapter *piix4_adapter, unsigned short piix4_smba); +int piix4_sb800_region_request(struct device *dev, struct sb800_mmio_cfg *mmio_cfg); +void piix4_sb800_region_release(struct device *dev, struct sb800_mmio_cfg *mmio_cfg); + #endif /* I2C_PIIX4_H */ From patchwork Mon Sep 23 08:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830272 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57238328B6 for ; Mon, 23 Sep 2024 08:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078743; cv=fail; b=VXhEQqOHbB7bh4wEYhjYQug668dGmMX1nIfvDyt/tWaGAv+VgXs9bej/aUiBPL+QnhDtyq8eV2D41bA0vse3dir4lbL9jF2JI+D8zgS61icCeiYH2sNsTKFTi9erM/oEh6usLGdsGkhJDXKCAB+bgU3Cnw728dCiD24x4JJJKIU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078743; c=relaxed/simple; bh=agyOK0F9jhLaqeFF8f5C8L+v/Vjazf+Gh8fZNC+6A6E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YI5cxPVor2w8zUEMhdoikBYVjLMkktUJjI36M2wMnRGp5SVqJKStqHJA5hL+aJVW2/0QNYSMKSMfPP62/yIPpYb7emdm1V0mZustjXywsKSD/ClH1Qwdc8wWuiDX5HwHLP1juxNCirzEZXqi28Bp1RI7hgglDroCg0/+RAHnldk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=P85P1iXO; arc=fail smtp.client-ip=40.107.223.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="P85P1iXO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yAEeih1YCAgqB4Z1hG48fpq1dUAcHug+CQTc0d/9br4hnFWqy0gjTY9kTom6G5lKAXGIxmZ2rA//E+u+lAvFirWWhA96fP/YQ/7N+tjYn4oaxnf0wm9oEVN2MB4MhJJsDEf5uo3aSps7sWeC6KEnRYwZ9DqvdaVxcDp7641eHEkupKTn7XHEx6bWgTVlIUtXBgiUhpHP2Pi9GGYYiZrR07bZ+H03zMibYzUFr60osiY/y0Ccb3t+Ie19VuI+hO/bQISGFA93x6OAt8Sx03XQO//bQVWXtbmpMZu+WBEsUrfhgQcgJFSNso5st4dDYWyAMxTiOBDFCMObHP/kaXdawg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5mQotfSMU0EaK8KeGJK4J36wVdjIQ2hazDI4N6lDH+U=; b=jMLi3M8RYUDiYJhKD/+eCHXoKZSPeJAErD7YcBigq0UEl5Gaz5W5ewapMeEbeHVliHNkyGjpw/IzoB6oOITa7pRmYCEz580lcR6JMn5bn6Q8XXJKUIk92WpkqRTRFVjvBYYNcVFSBkBPe9bl6AOdD5RFVU1S081axigoze8O/M1fH+O9w6/3euU6ujRQaQQwiGB8pyOB7SoIBb6ozcKXsUo+ivbmzvKffg4mvtP3teYQbVRtEL6xW8CcJD2+8Gkppe+QB5dZtRAKzkRxNaZHeoy/n03qy3DtVJkvYjxUQvFA+Or0aX+8shO1dE6Z8rMzoADwylgJ7dch5s2oXdYBOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5mQotfSMU0EaK8KeGJK4J36wVdjIQ2hazDI4N6lDH+U=; b=P85P1iXO4AiEsIuAxcz8nVYhKvEo9AdHuRRRV9WWdygUKymdQ70wnYRaXUmt7ImMXvVtJ05CuvB9ojYn3OIBE507HZ0m8Vm7C9WEnD1PjK2nt8YZ1iKb68sKdNCSQumI+gUV+cCkNB54uGjoWPKHFTe7m+t4HrOuuWW7oFVqsxg= Received: from SJ0PR03CA0368.namprd03.prod.outlook.com (2603:10b6:a03:3a1::13) by CH3PR12MB7620.namprd12.prod.outlook.com (2603:10b6:610:150::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.26; Mon, 23 Sep 2024 08:05:35 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::74) by SJ0PR03CA0368.outlook.office365.com (2603:10b6:a03:3a1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.27 via Frontend Transport; Mon, 23 Sep 2024 08:05:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:34 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:27 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 4/8] i2c: amd-asf: Add ACPI support for AMD ASF Controller Date: Mon, 23 Sep 2024 13:33:57 +0530 Message-ID: <20240923080401.2167310-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|CH3PR12MB7620:EE_ X-MS-Office365-Filtering-Correlation-Id: 0243ace6-f3c1-43bb-acc7-08dcdba68096 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: IK2BMejVGmHk7L4ss2z244z2sjzswvmbBVS0vbatONkAcnBm1FaEdJe80vAOHQsYfac3U9BJYKy+FhqSpKJwJcBoT1ITJt7M9vxF9imjQNGTMWvygRmcSil0DyNKX+fSQ/6Po1LpYUiwjN3eCuDo24NSCLhb2T9Q1dm3sTUQdvBtm0o2NM5bOyAk7UDY8MBcpEYz5Ovq/fMMuXLYP4TNgDD3BM+KHt/ujNYjmGJBPk9viw9s2OXs+GwlrR7FQCO2A7omQpszUDp9eMEs4clwZeCa0woWnHOTlKvLXJpMhA5FDA4gMU6UET/B83XHSZc5s5/lhljLHYU9/L99nzKpsCjkqmCem/s7bgkVoii0qrBiDrdDJcxxf7vMIzLOIsdKoa0r+uOTEiHFSXGAYHxo3eJrCR6c27aBzSJ9bxKnouejLeJvGHgIVwL5cr09I2tWJ5gJKfzOzj0E6obLcjGnlHwdy40HOwxgT0LI4Psby2lQjznCFK1VgkkUqpvZbe6hvEz2LhWSP9h+j9BoSl1wTz+gR3sqrk1Br7t1BZFl5D8TPSLCgG43HWqtHSIoY0BM8+r3ZiMMD9bxD5tZ69Qto8JpvV9rz1QNHwdY2kQnrHI5Q1mg/CYRcjrYLaTci0NOfZCbK+GafB6rzu79+vFIU0j/5Xvv/RnSHslj/ds1g6RYvztgSLUqQW0GSYJNPY5FUTA7v/JgwJb3mNp7KVSenWCmn90ZFBlVuM22oOn0KIXO2aDKKbGhja9PheqVYx9fxq0OT95qr9z6y+cG/64FSC4vSmbphgzLVnFLUhvnzA6zlt2OjVLpt61k/i6UrhXBT30ovJNoaaFytZExJiZMTTTkRzQn/E2LlPB5z0WmYRxf4m1V1pi+rCmFydgWh/fw/8mjEwzGz78wF5l9sDGXi5luOHjcSEOIhYOHYZ4eQf0T/QJDO50TN0iDJkDSyJQFzGM6FuXgJpBMTJluKa3dQMERzYKUxWV3xzDr60BTxVRDKjVz6Udpe7lgcuODJtwrqHq5MXEURPlMwLf2A8Wcm/B0JVLAph1DHAf+LnHajgTmNbpMAvpw6T9qY6k9h26vEH6EIC3/4t5W0ZoTc1B2pJWIavxbITTGc4QsOIuh0Qt6kWore0khdHrfekk1L6eZuJ1PQb23GxlA3/EZpak6zZaQ9lnm/YJqzVbRMWCX5n9T28NNuNisx9z5+Hbr/fxJlwAtNn7S0YIyz8sN3lO37s8foCBo0d7fP2XqQ18P13gKSB0u6/PY3i/c4W7I8FR3pT/g6QYVZDvhjSnB94xFdnrbAhTQ0rrCnoKYQ/Mcw7wtW2O9my3yJWPTSDHurjqjlFdTpiWn8kKfI72YNcg37Kwg09Qf2qB3FMqMgkH28JQ= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:34.6773 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0243ace6-f3c1-43bb-acc7-08dcdba68096 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7620 The AMD ASF controller is presented to the operating system as an ACPI device. The AMD ASF driver can use ACPI to obtain information about the ASF controller's attributes, such as the ASF address space and interrupt number, and to handle ASF interrupts. Currently, the piix4 driver assumes that a specific port address is designated for AUX operations. However, with the introduction of ASF, the same port address may also be used by the ASF controller. Therefore, a check needs to be added to ensure that if ASF is advertised and enabled in ACPI, the AUX port should not be configured. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i2c/busses/Kconfig | 16 ++++++ drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-amd-asf-plat.c | 70 +++++++++++++++++++++++++++ drivers/i2c/busses/i2c-piix4.c | 12 ++++- 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 drivers/i2c/busses/i2c-amd-asf-plat.c diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index a22f9125322a..03afcdbff209 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -95,6 +95,22 @@ config I2C_AMD_MP2 This driver can also be built as modules. If so, the modules will be called i2c-amd-mp2-pci and i2c-amd-mp2-plat. +config I2C_AMD_ASF + tristate "AMD ASF I2C Controller Support" + depends on I2C_PIIX4 + help + This option enables support for the AMD ASF (Alert Standard Format) + I2C controller. The AMD ASF controller is an SMBus controller with + built-in ASF functionality, allowing it to issue generic SMBus + packets and communicate with the DASH controller using MCTP over + ASF. + + If you have an AMD system with ASF support and want to enable this + functionality, say Y or M here. If unsure, say N. + + To compile this driver as a module, choose M here: the module will + be called i2c_amd_asf_plat. + config I2C_HIX5HD2 tristate "Hix5hd2 high-speed I2C driver" depends on ARCH_HISI || ARCH_HIX5HD2 || COMPILE_TEST diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index 78d0561339e5..74920380a337 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o # Embedded system I2C/SMBus host controller drivers obj-$(CONFIG_I2C_ALTERA) += i2c-altera.o obj-$(CONFIG_I2C_AMD_MP2) += i2c-amd-mp2-pci.o i2c-amd-mp2-plat.o +obj-$(CONFIG_I2C_AMD_ASF) += i2c-amd-asf-plat.o obj-$(CONFIG_I2C_ASPEED) += i2c-aspeed.o obj-$(CONFIG_I2C_AT91) += i2c-at91.o i2c-at91-objs := i2c-at91-core.o i2c-at91-master.o diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c new file mode 100644 index 000000000000..ccb547e14414 --- /dev/null +++ b/drivers/i2c/busses/i2c-amd-asf-plat.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * AMD Alert Standard Format Platform Driver + * + * Copyright (c) 2024, Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Authors: Shyam Sundar S K + * Sanket Goswami + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "i2c-piix4.h" + +struct amd_asf_dev { + struct i2c_adapter adap; + struct sb800_mmio_cfg mmio_cfg; + struct resource *port_addr; +}; + +static int amd_asf_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct amd_asf_dev *asf_dev; + + asf_dev = devm_kzalloc(dev, sizeof(*asf_dev), GFP_KERNEL); + if (!asf_dev) + return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n"); + + asf_dev->mmio_cfg.use_mmio = true; + asf_dev->port_addr = platform_get_resource(pdev, IORESOURCE_IO, 0); + if (!asf_dev->port_addr) + return dev_err_probe(dev, -EINVAL, "missing IO resources\n"); + + asf_dev->adap.owner = THIS_MODULE; + asf_dev->adap.dev.parent = &pdev->dev; + + i2c_set_adapdata(&asf_dev->adap, asf_dev); + snprintf(asf_dev->adap.name, sizeof(asf_dev->adap.name), "AMD ASF adapter"); + + return devm_i2c_add_adapter(dev, &asf_dev->adap); +} + +static const struct acpi_device_id amd_asf_acpi_ids[] = { + { "AMDI001A" }, + { } +}; +MODULE_DEVICE_TABLE(acpi, amd_asf_acpi_ids); + +static struct platform_driver amd_asf_driver = { + .driver = { + .name = "i2c-amd-asf", + .acpi_match_table = amd_asf_acpi_ids, + }, + .probe = amd_asf_probe, +}; +module_platform_driver(amd_asf_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("AMD Alert Standard Format Driver"); diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index ee76ccc71697..59b99081938d 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -87,6 +87,7 @@ #define SB800_PIIX4_FCH_PM_ADDR 0xFED80300 #define SB800_PIIX4_FCH_PM_SIZE 8 +#define SB800_ASF_ACPI_PATH "\\_SB.ASFC" /* insmod parameters */ @@ -1024,6 +1025,9 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id) { int retval; bool is_sb800 = false; + bool is_asf = false; + acpi_status status; + acpi_handle handle; if ((dev->vendor == PCI_VENDOR_ID_ATI && dev->device == PCI_DEVICE_ID_ATI_SBX00_SMBUS && @@ -1086,10 +1090,16 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id) } } + status = acpi_get_handle(NULL, (acpi_string)SB800_ASF_ACPI_PATH, &handle); + if (ACPI_SUCCESS(status)) + is_asf = true; + if (dev->vendor == PCI_VENDOR_ID_AMD && (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS || dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS)) { - retval = piix4_setup_sb800(dev, id, 1); + /* Do not setup AUX port if ASF is enabled */ + if (!is_asf) + retval = piix4_setup_sb800(dev, id, 1); } if (retval > 0) { From patchwork Mon Sep 23 08:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830389 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2084.outbound.protection.outlook.com [40.107.93.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 782093C485 for ; Mon, 23 Sep 2024 08:05:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078741; cv=fail; b=T1vDBMtNtZ8P0AZ5x6+s+vo8+cfg259Pw6y+BNbGVvN6La8tmk82+pk8BFlwRR/Jc4yTiAHaIlm7A0kq6pfd0BaSrF2M5Y/spGbxSN3VGByZXF3xakxQZuJvJQuu5dT9lWcG3mbr6s/6+T+DIrwZ/6KipwBchu4DCEv9V0gyeqc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078741; c=relaxed/simple; bh=Lno5JBsGGrrOfwPf1vAhMbD37ANJ63fdlzH5k9EkIjQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GLL8+/kcNQU3A3GuojxXWGH8B8IlQNPJsuolSyq6C6a1MZNG8t9JrMLY4J4/FASIDUKtzuSvLZn3WCYXPraf/w6A49ztMSYFKTphLs6wDMR7Xksm0mBYuR8XQS8VIZ9hXreLQke0AJic534DyibiG5VOutJ6+c7a2fIhRryGJoY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=AZnGcOB3; arc=fail smtp.client-ip=40.107.93.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="AZnGcOB3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xgKJeCTHHHnm9srObVmt2oQu3fTK94cegwW52NDBESldzczt10+kyWJz0xyfvI7aSHG6ocb7ZAvZP6fexn1aGx8o8IgAgyFB1EFjnjqYb8ryJiTUF/MZbDGoPYduPRGOkSDEplm+x+a1qPGuZMiOJWvL8HBegcLX9LqGfZ9GAscTtpT9w4fnRUaHZZcCzBDn/NvR7p+YMdHw7S6UWdOv2dwsdy/fFrzSiXq905CUTo3nQSVze0nMOdWllGKgblXEGUONN6yYFkGmw4NCqhSg6Ycs7Sr2l3ZZXEb73/8h7JuX2AHkfm2Sm2xC4yMjT62xM1lmvQOTusjnOPaaacGhhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YPBjLv8lSSPBf4CmtykfDPotsxsS2FO2DigoqBfWnfE=; b=bCORBLTkLs8kNeuBvSRm42EMoHiwLa9ZndNpBi7fQh179u8/cZ9+9X64Eo9bHuF0TkKSpGuikuKigweQl57WcDuR3FP7R0f5uNAeK1xnXUlniL3ImMkCUUHBjL46MPSUwEZjyRjPrpDDp/2qdbGfF7IHnZ63TlOe3zn1m+L2I8eKv+/OYsD8I88lvRIXjICA40/6xNaIBWufRAkPtexpwjT3z64pTkZAJubbu5FJ3OoP1VIuQdJDm/AcTgZNKojwS4NyTFL+vkBKI1iWTIZlimwthgxhwFABH6K4QD7er93ok8VMHIjWJc6OFpfeiLzjFPB3ZzXjViQ+zen+8vM9/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YPBjLv8lSSPBf4CmtykfDPotsxsS2FO2DigoqBfWnfE=; b=AZnGcOB3PwlLwgq53LdZ4nOlmVk1XHwis1DorrBHKnyVfUhxkfCQfzpP12456AdVQ1pOULgJwmKP6roelKdPHChzagRO4+zql86tKyCw/kORb7kR1jjFT/yMNvY13DtONGhDNa/M1PocBWL+uyaIAOeeAW6kqWUZpp25vD8Vuks= Received: from SJ0PR03CA0361.namprd03.prod.outlook.com (2603:10b6:a03:3a1::6) by LV2PR12MB5941.namprd12.prod.outlook.com (2603:10b6:408:172::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:36 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::96) by SJ0PR03CA0361.outlook.office365.com (2603:10b6:a03:3a1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30 via Frontend Transport; Mon, 23 Sep 2024 08:05:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:35 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:30 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 5/8] i2c: amd-asf: Add i2c_algorithm operations to support AMD ASF with SMBus Date: Mon, 23 Sep 2024 13:33:58 +0530 Message-ID: <20240923080401.2167310-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|LV2PR12MB5941:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d036f64-99bb-4695-6a95-08dcdba68136 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: tR76PAbS6L7EtUR4XRu2YxjJmFcrZv2TWUbEXy2tVi+2fMrjoNZ8w5/5ahmI5uxVyw30yILVRSdpOpnj4OU5+QKLY0JuT2nTQG5XQ7qKYZzc/7Uo0b/Nj7kdFKZMIYZUZe4DusImZE10w8DuS+0Th+UibC4WLkXH+xf3q7QgLlhowYihWCukw6ilEWh03WEPYZaK9FEWxjhBl703+x56+2nHpmvnlNsoeO3wCsGGotPL+hcgikypmdQtEdO/yyScIYujTREmxzAJpu/29o0Ai8Ng8Cl/wmVeQMAw93LpQuS0HXqypshiic7Q/A9c6h5herShqfjTvlkIHIQt2YUh7eg5iTHk2L0ItuQt6ymPetnlaLZu5bvh9q6QTQRphHo4wY/rFKU5HJynYY5c6E3Pevcmhk080fDTeg6Nnw4Apus+GsBStJY5j1ARCVmMiKRycec/Zqif20LenZIOrZ4yaOFEFGD2yhEtPJVOMU2/3PsdjHEy2N8V9ezAWmul5YeDgb52fWmc5i5bXzl1ZJ19W4VCEDeomtSzeYYSOsIwTiw/fHnqHmJ9dzEhjHH2+v+Ib4J74fulrg9OwKjdbgF22V7/+q0Dxs6UI+fYEijoO6bXUAJd8rlw/3VrKEFw6Nr/rtAkQa1YjzTD3Kc8Hp9XXE7vZ8/4FzlrmQo4aBt97hVQQzzfsKwOyllkC78sJbVqIQgwYvQ4s3rwcwkqLV5Ur0wb/WZGcraLbLj5dLou4GsfQyNLKMMVBYG/W8igKhkzyt8twUri+fn9zZIw/0m3ZVIhkjY94qOPMOaLoA6vdxqYAOiigoro5qQEbI72aygw/K/B0AlOA+z1lBdA6W/WEz3NLtptMz8XtnSOsTXfz71TE1IcKNdkKDEWiaegJTes6f7uGLtWQb2/wttocoPIqvPa2N0GX1jlidbT1YxY0tUBMSTBaf6PkTkRFF9FnAIvg46gey/tr9+NJioSSOy+mkqog9FDWFAx1AaR7cTm4dMz3a0khsxgzKCIDdChz/Vd6QcIRGm/x1IwVjsrIuHmKyzAlRaLZO5V5sDxywiABUAeZoxymODfYt9jmAhqhgO0j5Aacon2OF/r3vpNoUjhmhn6QSBI0cWsQG3IwaOd+vtaGh/qdK5oLEL/af5pMvwPwTUgBiBwQ2mXZCLHVUjojeypvl3bfMvDmfO1F4xK/pQrgvUQ/4YB6k3mZeSx9VxXBiLwuobw45pMO8rC8yhTIkne5AUoMddViPCMk6o9zviOFRrsTBMrQwI7aMT0tyo1qxeBxZ74ifafTHrmUxaS+QvV7r28BktUa9a4AmiOcC4bUmHsu0tsxTIIejPrSEBLzsRbeqTjeXEKTk9bBl31zDhUlbLecDJLTuXr0mvDgQguUEI/BNqhd/aCDr3GcD8a X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:35.7242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d036f64-99bb-4695-6a95-08dcdba68136 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5941 Implement the i2c_algorithm operations to enable support for AMD ASF (Alert Standard Format) with SMBus. This enhancement includes: - Adding functionality to identify and select the supported ASF functions. - Implementing mechanisms for registering and deregistering I2C slave devices. - Providing support for data transfer operations over ASF. Additionally, include a 'select' Kconfig entry as the current patch utilizes .reg_slave() and .unreg_slave() callbacks, which are controlled by CONFIG_I2C_SLAVE. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i2c/busses/Kconfig | 1 + drivers/i2c/busses/i2c-amd-asf-plat.c | 181 ++++++++++++++++++++++++++ 2 files changed, 182 insertions(+) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 03afcdbff209..9353946882db 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -98,6 +98,7 @@ config I2C_AMD_MP2 config I2C_AMD_ASF tristate "AMD ASF I2C Controller Support" depends on I2C_PIIX4 + select I2C_SLAVE help This option enables support for the AMD ASF (Alert Standard Format) I2C controller. The AMD ASF controller is an SMBus controller with diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c index ccb547e14414..216b194202ba 100644 --- a/drivers/i2c/busses/i2c-amd-asf-plat.c +++ b/drivers/i2c/busses/i2c-amd-asf-plat.c @@ -9,6 +9,7 @@ * Sanket Goswami */ +#include #include #include #include @@ -22,12 +23,190 @@ #include "i2c-piix4.h" +/* ASF register bits */ +#define ASF_SLV_LISTN 0 +#define ASF_SLV_INTR 1 +#define ASF_SLV_RST 4 +#define ASF_PEC_SP 5 +#define ASF_DATA_EN 7 +#define ASF_MSTR_EN 16 +#define ASF_CLK_EN 17 + +/* ASF address offsets */ +#define ASFLISADDR (0x09 + piix4_smba) +#define ASFSTA (0x0A + piix4_smba) +#define ASFSLVSTA (0x0D + piix4_smba) +#define ASFDATABNKSEL (0x13 + piix4_smba) +#define ASFSLVEN (0x15 + piix4_smba) + +#define ASF_BLOCK_MAX_BYTES 72 + struct amd_asf_dev { struct i2c_adapter adap; + struct i2c_client *target; struct sb800_mmio_cfg mmio_cfg; struct resource *port_addr; }; +static void amd_asf_update_ioport_target(unsigned short piix4_smba, u8 bit, + unsigned long offset, bool set) +{ + unsigned long reg; + + reg = inb_p(offset); + __assign_bit(bit, ®, set); + outb_p(reg, offset); +} + +static void amd_asf_update_mmio_target(struct amd_asf_dev *dev, u8 bit, bool set) +{ + unsigned long reg; + + reg = ioread32(dev->mmio_cfg.addr); + __assign_bit(bit, ®, set); + iowrite32(reg, dev->mmio_cfg.addr); +} + +static void amd_asf_setup_target(struct amd_asf_dev *dev) +{ + unsigned short piix4_smba = dev->port_addr->start; + + /* Reset both host and target before setting up */ + outb_p(0, SMBHSTSTS); + outb_p(0, ASFSLVSTA); + outb_p(0, ASFSTA); + + /* Update target address */ + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_LISTN, ASFLISADDR, true); + /* Enable target and set the clock */ + amd_asf_update_mmio_target(dev, ASF_MSTR_EN, false); + amd_asf_update_mmio_target(dev, ASF_CLK_EN, true); + /* Enable target interrupt */ + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_INTR, ASFSLVEN, true); + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_RST, ASFSLVEN, false); + /* Enable PEC and PEC append */ + amd_asf_update_ioport_target(piix4_smba, ASF_DATA_EN, SMBHSTCNT, true); + amd_asf_update_ioport_target(piix4_smba, ASF_PEC_SP, SMBHSTCNT, true); +} + +static int amd_asf_access(struct i2c_adapter *adap, u16 addr, u8 command, u8 *data) +{ + struct amd_asf_dev *dev = i2c_get_adapdata(adap); + unsigned short piix4_smba = dev->port_addr->start; + u8 i, len; + + outb_p((addr << 1), SMBHSTADD); + outb_p(command, SMBHSTCMD); + len = data[0]; + if (len == 0 || len > ASF_BLOCK_MAX_BYTES) + return -EINVAL; + + outb_p(len, SMBHSTDAT0); + /* Reset SMBBLKDAT */ + inb_p(SMBHSTCNT); + for (i = 1; i <= len; i++) + outb_p(data[i], SMBBLKDAT); + + outb_p(PIIX4_BLOCK_DATA, SMBHSTCNT); + /* Enable PEC and PEC append */ + amd_asf_update_ioport_target(piix4_smba, ASF_DATA_EN, SMBHSTCNT, true); + amd_asf_update_ioport_target(piix4_smba, ASF_PEC_SP, SMBHSTCNT, true); + + return piix4_transaction(adap, piix4_smba); +} + +static int amd_asf_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) +{ + struct amd_asf_dev *dev = i2c_get_adapdata(adap); + unsigned short piix4_smba = dev->port_addr->start; + u8 asf_data[ASF_BLOCK_MAX_BYTES]; + struct i2c_msg *dev_msgs = msgs; + u8 prev_port; + int ret; + + if (msgs->flags & I2C_M_RD) { + dev_err(&adap->dev, "ASF: Read not supported\n"); + return -EOPNOTSUPP; + } + + /* Exclude the receive header and PEC */ + if (msgs->len > ASF_BLOCK_MAX_BYTES - 3) { + dev_warn(&adap->dev, "ASF: max message length exceeded\n"); + return -EOPNOTSUPP; + } + + asf_data[0] = dev_msgs->len; + memcpy(asf_data + 1, dev_msgs[0].buf, dev_msgs->len); + + ret = piix4_sb800_region_request(&adap->dev, &dev->mmio_cfg); + if (ret) + return ret; + + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_RST, ASFSLVEN, true); + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_LISTN, ASFLISADDR, false); + /* Clear ASF target status */ + outb_p(0, ASFSLVSTA); + + /* Enable ASF SMBus controller function */ + amd_asf_update_mmio_target(dev, ASF_MSTR_EN, true); + prev_port = piix4_sb800_port_sel(0, &dev->mmio_cfg); + ret = amd_asf_access(adap, msgs->addr, msgs[0].buf[0], asf_data); + piix4_sb800_port_sel(prev_port, &dev->mmio_cfg); + amd_asf_setup_target(dev); + piix4_sb800_region_release(&adap->dev, &dev->mmio_cfg); + return ret; +} + +static int amd_asf_reg_target(struct i2c_client *target) +{ + struct amd_asf_dev *dev = i2c_get_adapdata(target->adapter); + unsigned short piix4_smba = dev->port_addr->start; + int ret; + u8 reg; + + if (dev->target) + return -EBUSY; + + ret = piix4_sb800_region_request(&target->dev, &dev->mmio_cfg); + if (ret) + return ret; + + reg = (target->addr << 1) | I2C_M_RD; + outb_p(reg, ASFLISADDR); + + amd_asf_setup_target(dev); + dev->target = target; + amd_asf_update_ioport_target(piix4_smba, ASF_DATA_EN, ASFDATABNKSEL, false); + piix4_sb800_region_release(&target->dev, &dev->mmio_cfg); + + return 0; +} + +static int amd_asf_unreg_target(struct i2c_client *target) +{ + struct amd_asf_dev *dev = i2c_get_adapdata(target->adapter); + unsigned short piix4_smba = dev->port_addr->start; + + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_INTR, ASFSLVEN, false); + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_RST, ASFSLVEN, true); + dev->target = NULL; + + return 0; +} + +static u32 amd_asf_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | I2C_FUNC_SMBUS_BLOCK_DATA | + I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_PEC | I2C_FUNC_SLAVE; +} + +static const struct i2c_algorithm amd_asf_smbus_algorithm = { + .master_xfer = amd_asf_xfer, + .reg_slave = amd_asf_reg_target, + .unreg_slave = amd_asf_unreg_target, + .functionality = amd_asf_func, +}; + static int amd_asf_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -43,6 +222,7 @@ static int amd_asf_probe(struct platform_device *pdev) return dev_err_probe(dev, -EINVAL, "missing IO resources\n"); asf_dev->adap.owner = THIS_MODULE; + asf_dev->adap.algo = &amd_asf_smbus_algorithm; asf_dev->adap.dev.parent = &pdev->dev; i2c_set_adapdata(&asf_dev->adap, asf_dev); @@ -66,5 +246,6 @@ static struct platform_driver amd_asf_driver = { }; module_platform_driver(amd_asf_driver); +MODULE_IMPORT_NS(PIIX4_SMBUS); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("AMD Alert Standard Format Driver"); From patchwork Mon Sep 23 08:03:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830388 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2085.outbound.protection.outlook.com [40.107.236.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 445AB2AE96 for ; Mon, 23 Sep 2024 08:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078743; cv=fail; b=qBm6yoorJTxONql9JcawOwbq5bYtKUIhfEG3+HFHfCfKHRrEsfVNr9IRI1/h4BwRmZcT4euEhM0skIm9pUrruXN/P+Ey0Ov6h92O/XY+YhlpvV2SKd0mr4kbFXnBb/1t8P87Y5VLS0czxDtcgmnc/6wP8lB4CzMQSIcU58+m3Aw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078743; c=relaxed/simple; bh=FdXQ8xGtNzez4PNr/veR1I48iinOgzYmSShUYNSz9j0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jb+rQja74abRftbGscuxrmV99BXgSpXHIvJMCN8iVeQMQyXLvupdi4FfhVOvOCc4H5jTKV4IUd2N5ATspAUK00gi/L2m24lFh4m5vmm6zYczSr1URKjurgNslLOywas31Dj5MheFYIFfaZpMxVJb2oLxTCAQgIY8a06nTeoea6w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=tjrMogpJ; arc=fail smtp.client-ip=40.107.236.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tjrMogpJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tDIGXXKKRFJAJeApNT/+eBvjWIbyF86hRrKJFPpmb+VaJobZr01My4Cl/VV5/rqtN3eQ16/EU7Ozr0e8wLqoeNg9YXchL1Il5n53xxZqmeow5UOyywMLJwoBvuZGUchFAd6OSbcpxoy0cbAzeiCNeLBKjRa+WfuR+QvxeHfS0lI5QzrdNE5Dam3pD7iyacEgvs2lS6eirsAFpTE7PxDlgyqRBQfcnYd1G8yodnsflR0OoyOE7WoW6EIkQTGGjxCVD7AEfij+zsYw4Y8pJKVenzgjr77HfMIG+eZ9KnrJG6IOUoRvc6J5C+4wpuXzqAeAcNPawFgYAjvDWinOufeuBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eajFIDukOwiWMX21f4IkTRQC4c2eGYsVVIevBvTMBZQ=; b=MKL5z1P1q1P5D9SP1+VI8awBRgf4mCz6tyyXtWfwCk6+v5PCoXl9wCfxFxVeGJo0UJIp+bbCWdrzkGar9tJzFF75CRydaPT/xG3wW8mnMnA0Ihe6iok6D2uYcDH7Ty29+U/dlIkxDSdnVGYY9Y0a/yF++VSplygxXRWw0vHfW6mIv1GPJuSxnElzYlMMxedlxfAPxwL43G/C5NWV0VHDcn0O23BbKxrApjP1EPWNd4WvfOmCanjseNGTXnm2mfYAE/7S5WGkYIKr07M1nlbuUNCrgJYx7PwytdslxTJXSaLNlMZhfUB1Gqz5T1Yx3QF+u42cN/uYjKWecIxFBwz0RA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eajFIDukOwiWMX21f4IkTRQC4c2eGYsVVIevBvTMBZQ=; b=tjrMogpJlJLsnrurlmDsM4KxN59UaDz+EzNwH9BcYbkM7Is8GoU1ofqhpwAyjIAm4Rx6PyesifUiYe1wKgIO4g3JBts0qJialfD1cteX0I3q1fLY9CEycDLJ7seJ215F060jM8bJhtIlQeIzhpXhD1OaZ9eqXLGdtJh59hGjJV8= Received: from SJ0PR03CA0374.namprd03.prod.outlook.com (2603:10b6:a03:3a1::19) by MW3PR12MB4377.namprd12.prod.outlook.com (2603:10b6:303:55::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:37 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::83) by SJ0PR03CA0374.outlook.office365.com (2603:10b6:a03:3a1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Mon, 23 Sep 2024 08:05:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:36 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:32 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 6/8] i2c: amd-asf: Add routine to handle the ASF slave process Date: Mon, 23 Sep 2024 13:33:59 +0530 Message-ID: <20240923080401.2167310-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|MW3PR12MB4377:EE_ X-MS-Office365-Filtering-Correlation-Id: e1a138a2-e6c1-4aba-7694-08dcdba681e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: WSYnJYDAH1iB4XZoMvjIDJ2YXDih5kXfV9AQfpjbw0QpsiX51+wxMMvkU9GqnrXDf0UFiN+iEJlz/wBdwWGe5X2BnHDDi5Q91lnhxlu/ZBOdPQgX2G8/rjOOLk4ob+/jzAoCJ2IUel5R++MDBiGujP7IF3UbsDk/5tpHDaXPpNT0JEcbMD9VyImZpsQTe0vHZbP4aNpsZyHcOR+4DURgYjh42LPvBf+y0jo9sFQlMPuEuWu3PXN4AYpkCDBzftyBQr3fa0piMzwe0vBWWxkK8hdHUMpYCunDt3eEe3OmzKNovp6+sIOFMKwi8m93SpxHoYfWkfq05kvz7FNoTPLyQauouBCLUVGNZZQ41cmaGyjPzZaVQ43YTBx9HEPwvzVT+ux/4Yx8RjbjZeVd2sKHftqSvutVGP4OD6xM+9ngG1fIGeET0VRUtDwJ1xHt41SeVHfF0X7xohMq4MQPoLc/b6aF0D8BqKDcQnk2ed5bWnMKu47ZT4RX2RzO2E1k4cFjwEvOFk43KhHebgQYECAk85fNQYWvdlqDF4dg11EEBmV0mDf959Fh98i0fBbNwgGns7EAZQ/Ga6XDmJzZDl6NDRiG97Vsc1i16DWFPeGZfJncG7Ve78lC5afDvVkwoIWk6O41GkKeSpCc7KhnkHkSX4z8ePJMPn4GPlF2HUU3DrV+hbQpniVfCCz/TW9B4tkDcZIGWzrtS5phiANVe49u5rnGGhBLVsoYFNyn+J3RqtxmdDL9ZXN6BH0DYkI80LU9gLbNg9G1U1DzphfpqvYN/qXocuATS7qQG8lD+4qDG9XuxiClfbwivZnij1S2NdPFYtoxBG+fnyatWGBS3vcIGM0aLWLoRoTpLf1fzwwezyJ2YsKqlptKrxL/jmFLNu76qCzJxW6VcGP8lGJhHHRuznaWgJ7+ZBwQVdLceAk8JscrhK7hr5l68T6LYkrYetKe7AEQ+b8UnLamexHn7rQ15HruV6PgWkkV/J2sCK0PP0uVvGFiYjgE9mNdiFNDvoRlOL2Sh2fqXKZBoh51rIXdGNLyTEBb24SArtElccf2jGhBmmuNz+bhGgnpNOwIGAHS7L6SCE7qa1iKa+5FycmYpympO366hLDU97gnoWbjNTuezxjR71llGH/wat28kX9hVN3aGt+7N1EAU5EqgaQ9bzB9+evSAoDCSLzwVyJy9kfwAJ8/SO2+WFNquFEAn8jFt8XmRat+0ImQWeIYjocRY9minKzpXRtNODLEHy/8Oex/q/uqtJ288X1cvK9SndDA+YpChR43b64M1S1PgNockksvQu/yjyTKssNMbEIfbow+OdegaBc5NIJjYvxkqMLV6aSVG+Xd7ui8r33iYywMRRE3YWqC5bFuhK83RBz5km9D0vz4h7tmh6S19onDV8NN4x419O+0uM2VFty1I2VgSyNJt7Uf1P5FQ6jssO9/zwpI8WdznF4EUVqzwJRfgJRS X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:36.8649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1a138a2-e6c1-4aba-7694-08dcdba681e4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4377 Add support for handling ASF slave process events as described in the AMD ASF databook. This involves implementing the correct programming sequence to manage each ASF packet appropriately. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i2c/busses/i2c-amd-asf-plat.c | 101 ++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c index 216b194202ba..fa6db99a8fe5 100644 --- a/drivers/i2c/busses/i2c-amd-asf-plat.c +++ b/drivers/i2c/busses/i2c-amd-asf-plat.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -33,21 +34,90 @@ #define ASF_CLK_EN 17 /* ASF address offsets */ +#define ASFINDEX (0x07 + piix4_smba) #define ASFLISADDR (0x09 + piix4_smba) #define ASFSTA (0x0A + piix4_smba) #define ASFSLVSTA (0x0D + piix4_smba) +#define ASFDATARWPTR (0x11 + piix4_smba) +#define ASFSETDATARDPTR (0x12 + piix4_smba) #define ASFDATABNKSEL (0x13 + piix4_smba) #define ASFSLVEN (0x15 + piix4_smba) #define ASF_BLOCK_MAX_BYTES 72 +#define ASF_ERROR_STATUS GENMASK(3, 1) struct amd_asf_dev { struct i2c_adapter adap; struct i2c_client *target; + struct delayed_work work_buf; struct sb800_mmio_cfg mmio_cfg; struct resource *port_addr; }; +static void amd_asf_process_target(struct work_struct *work) +{ + struct amd_asf_dev *dev = container_of(work, struct amd_asf_dev, work_buf.work); + unsigned short piix4_smba = dev->port_addr->start; + u8 data[ASF_BLOCK_MAX_BYTES]; + u8 bank, reg, cmd; + u8 len, idx, val; + + /* Read target status register */ + reg = inb_p(ASFSLVSTA); + + /* Check if no error bits are set in target status register */ + if (reg & ASF_ERROR_STATUS) { + /* Set bank as full */ + cmd = 0; + reg |= GENMASK(3, 2); + outb_p(reg, ASFDATABNKSEL); + } else { + /* Read data bank */ + reg = inb_p(ASFDATABNKSEL); + bank = (reg & BIT(3)) ? 1 : 0; + + /* Set read data bank */ + if (bank) { + reg |= BIT(4); + reg &= ~BIT(3); + } else { + reg &= ~BIT(4); + reg &= ~BIT(2); + } + + /* Read command register */ + outb_p(reg, ASFDATABNKSEL); + cmd = inb_p(ASFINDEX); + len = inb_p(ASFDATARWPTR); + for (idx = 0; idx < len; idx++) + data[idx] = inb_p(ASFINDEX); + + /* Clear data bank status */ + if (bank) { + reg |= BIT(3); + outb_p(reg, ASFDATABNKSEL); + } else { + reg |= BIT(2); + outb_p(reg, ASFDATABNKSEL); + } + } + + outb_p(0, ASFSETDATARDPTR); + if (cmd & BIT(0)) + return; + + /* + * Although i2c_slave_event() returns an appropriate error code, we + * don't check it here because we're operating in the workqueue context. + */ + i2c_slave_event(dev->target, I2C_SLAVE_WRITE_REQUESTED, &val); + for (idx = 0; idx < len; idx++) { + val = data[idx]; + i2c_slave_event(dev->target, I2C_SLAVE_WRITE_RECEIVED, &val); + } + i2c_slave_event(dev->target, I2C_SLAVE_STOP, &val); +} + static void amd_asf_update_ioport_target(unsigned short piix4_smba, u8 bit, unsigned long offset, bool set) { @@ -207,10 +277,29 @@ static const struct i2c_algorithm amd_asf_smbus_algorithm = { .functionality = amd_asf_func, }; +static irqreturn_t amd_asf_irq_handler(int irq, void *ptr) +{ + struct amd_asf_dev *dev = ptr; + unsigned short piix4_smba = dev->port_addr->start; + u8 target_int = inb_p(ASFSTA); + + if (target_int & BIT(6)) { + /* Target Interrupt */ + outb_p(target_int | BIT(6), ASFSTA); + schedule_delayed_work(&dev->work_buf, HZ); + } else { + /* Controller Interrupt */ + amd_asf_update_ioport_target(piix4_smba, ASF_SLV_INTR, SMBHSTSTS, true); + } + + return IRQ_HANDLED; +} + static int amd_asf_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct amd_asf_dev *asf_dev; + int ret, irq; asf_dev = devm_kzalloc(dev, sizeof(*asf_dev), GFP_KERNEL); if (!asf_dev) @@ -221,6 +310,18 @@ static int amd_asf_probe(struct platform_device *pdev) if (!asf_dev->port_addr) return dev_err_probe(dev, -EINVAL, "missing IO resources\n"); + ret = devm_delayed_work_autocancel(dev, &asf_dev->work_buf, amd_asf_process_target); + if (ret) + return dev_err_probe(dev, ret, "failed to create work queue\n"); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return dev_err_probe(dev, irq, "missing IRQ resources\n"); + + ret = devm_request_irq(dev, irq, amd_asf_irq_handler, IRQF_SHARED, "amd_asf", asf_dev); + if (ret) + return dev_err_probe(dev, ret, "Unable to request irq: %d for use\n", irq); + asf_dev->adap.owner = THIS_MODULE; asf_dev->adap.algo = &amd_asf_smbus_algorithm; asf_dev->adap.dev.parent = &pdev->dev; From patchwork Mon Sep 23 08:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830387 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2085.outbound.protection.outlook.com [40.107.236.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCEFA49630 for ; Mon, 23 Sep 2024 08:05:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078744; cv=fail; b=Ug4F26bTT70H8M4h4mnWYRJNeveKxkCnWBqeTsYthqVT4HmlyCgsQ7uTx4M97OFS2vKZtDcmZllQEzV+yiyb0yWlqt4rqfDXbmsxFGInP3kg0SRgkbTZa1NaTlLTmlSACazl433sF1DvhC6IBOw//ucwOC2TgcI+oTPpQ8LMq7I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078744; c=relaxed/simple; bh=1TMxyjgBPESkBcUhIXg+cgdS2ERIxIkft0BsMuOXi9s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tUSo4p+Ea14htbutu0+FPJwFEBPs3izkjpIcV6z/RpOihTeauNtLBtRrf8MMOkuOLAWQzNtoRvLpd2IqMeavB8NjLrb+KPr4JUTE/WUkxIUa8yt1jFTujoxzMe6YNFWTG8YisaiKQpWraZH/e1E+SoPg7vMV9fQwOW/P18Asoc0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=wK0+9z/8; arc=fail smtp.client-ip=40.107.236.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wK0+9z/8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wxub39ni2YPLKQqw8hXw0vDs8lAd8rj1HGHgA/iOvd8S5ac3xPozmMTb8O8UPZCdRwQDEbYs6qNhS9N73Sp7ukhUILtG/E/yYGRQ4mL6EXhsJsHF6mKuSpsk+ffZCita59XnomgGvTDDaAOj6zINJlvD4rP/SBrIieoSZUkUsASpNGfQglrlcnRo/sbp1O8VqIvODN2MSzCyAbZXeTSH0GkuqvqKMT6JNJO8w7Y3UVcvNNL2SCsEuGQEfpBfDh2TWVul3EY1ftiQYqwEsl63KmmGYqLuVPQsbaUSTKcCestkMPM/83OcHH0P89fjZ0pbx74OwN2yvlaV8ivBlrln/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kJEhbhcqQubcqRymaQD/K6U1U2lww2KWETV3Clml4LI=; b=DdoDdrgpLAOqExdnIZlmwKVLzb+idpJNrditLwOl6iBCHp+VTiztBWU9owAVpdKz8clkq4PBPQhKRNC9mH3GOvIZJmvPGT+VmPGgi4+Eh21sOQZbH5m9c0A7qDv7V4oa4mryJsYekG2bcX8++2rqCIwPYKqIwQu5BDP/ocAcOJPopSHXw7NlnC/FeXluqGv0i1APCQMZf8g7yxnuumzZ4xuwGOgpZmFlls+ImmUlSvxoFfMtTvvNVe/gDrMwNwvTgmnrXe6um2rGLAoh6UsNlWLJgMWiJLVGdleqcj2xqjMoKKD4/QO5SoM68HU3Bnt8w3/OhN1qre00bFAXRwaSbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kJEhbhcqQubcqRymaQD/K6U1U2lww2KWETV3Clml4LI=; b=wK0+9z/8ObpLlIu8wjxGvzh52g+RGQi5sulisglfmKGTkp5aVM8kZVM3ZIxST9g6mH7O0jQ2Bf0R9TFyUZlJ+igWNrhxQDFYbrBauVNu9Kbigk12wrI+aK9dsu2XSBXa3iK8XZkBW+vukMjMNBtuHRQncyFjIaRGys4gvmg2grw= Received: from SJ0PR03CA0379.namprd03.prod.outlook.com (2603:10b6:a03:3a1::24) by IA1PR12MB7712.namprd12.prod.outlook.com (2603:10b6:208:420::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:38 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:3a1:cafe::f0) by SJ0PR03CA0379.outlook.office365.com (2603:10b6:a03:3a1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.29 via Frontend Transport; Mon, 23 Sep 2024 08:05:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:37 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:35 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 7/8] i2c: amd-asf: Clear remote IRR bit to get successive interrupt Date: Mon, 23 Sep 2024 13:34:00 +0530 Message-ID: <20240923080401.2167310-8-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|IA1PR12MB7712:EE_ X-MS-Office365-Filtering-Correlation-Id: 27e3c604-715b-4290-e607-08dcdba68275 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: Lt7TuMRH15R8AeeqUCHf/saFjKQtONddpZbd9bFPYrDSLTHSF6MSa5/FflOtwagjtKJsjNrd3RABhmnaMscT4cR+bBXFJP8U2TlRZcukYl0hTj9ICOxIPxXZJeRs0vAQDdYkcNRyUYm2M/B38fPp+xePi/ct5N6lHDhT+xwq81u8yFfsLDxgRhaYUYFzlt+ENR/VtDONt/pzeQgUf+D8GtH4HuiZcMWkvkoWQ+UWdNZtQ/XfOP6iM2yEWiq1mIsq3iuCZ3lI99rdt/F3/zgFnzaS1LfRMSS7XBh3vMmgQchW5lEYAtoK5r5uSY/Dl97VHKC+uM8CmVpKxQY0J9OuOvYspInIHqoum9CEXzuy2xbqSYWM4g82yZ+yNPExJhdUxNNjlXEF8sxN0Y7NFGgcnK3peMqVkViHxTOZXGYZIC/pVhQAR/wQS53BeM0Tx+U31tWWcI6ZTVZp5BjTX24ZjquP+psO7DF4+Dp06xzQMa1CwWAb2Uhf5bo+1jlI9tMPzs9AHJSFSEDiqqmF0XHFq5MwhI5eqRBBGD0wZHw+AA2bRSdzqbwxUym5uxZpgWVkDJT2qbvQGCEmrvWs0mF1RS/h/uDNNw7YPv5A0uuCij0+ub1k05kyR6Af0d9h968FvOYKh6FpnN3oFwCSwSt0m0XUQ48DqLVaC96YWbbes+VNQi1H4wtrWkSqYHliRXJZoAFnFI3jmfA9RMWqaaeqwlIdIFGdEYnWnJJZsI23S/F+4Ej+wS6/FUkJ0w43MrB1P/5R6vyzapHC6DhVhM6tE16E5/x9l3s/3oyq79tBbDVcBjY/1SsCjUoIsY4a4qWx5tm4/57iOtenHYCpT4Sw/b2KAU7sx8ue6dD7PGXtKQoGING/oPVG4b85LI9r6LfjMDDeK3BQxcjznOC9JSdYxecQduWfSaKxIAoOY5XcvripusYiL3VlZwsKPvpGYATooGuH0V1zHi4LVpWeofSszyE8mAyAfYk3XH8PbhTnf9yQMJZD1Rbtqpx1V3rLEcUxFNaULWns2yM1tFZVxf3YFJTozq5kQjBKK41juQ4qDirs8jW3lKHLPejpm2VHl8tk3OLMTprvYyF0iVJ+RXjyQ8gcFrfft5gRIamTw0KAr02hE9yV0UI81uanqLx3yIiWXjMH5Hq+E9JiWvoTPnK7kDfl7rEgcMiasDYcoPYQtxnT04ANXIsAPB3/Pz7SD8FzvHVeYpw3JEZZQK5dpnDRBlFoFOy5HTaMnaA4GbvRLEoHPi2p78zP8/Wx6B0avgvtuUlRUAEEF7sQjAIJbAGJPrRNHD3nkjM8mZLk+EzyhonFLhJN/WFxdX0TZlqdqLluDnHi1nu1qt3CnaHkQ2Co7i9/Rc3K/KuodTZxZAmWs3yIDhZK+RFluT4ybxapVcoJoANuYMmYovvIRpVt4f6rsKUxF8BGF/07+kCCaHxs4MxOsxH45aTsjzA+9WRFmgJ2 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:37.8024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27e3c604-715b-4290-e607-08dcdba68275 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712 To ensure successive interrupts upon packet reception, it is necessary to clear the remote IRR bit by writing the interrupt number to the EOI register. The base address for this operation is provided by the BIOS and retrieved by the driver by traversing the ASF object's namespace. Reviewed-by: Andy Shevchenko Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/i2c/busses/i2c-amd-asf-plat.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c index fa6db99a8fe5..3d15b1be8686 100644 --- a/drivers/i2c/busses/i2c-amd-asf-plat.c +++ b/drivers/i2c/busses/i2c-amd-asf-plat.c @@ -48,6 +48,7 @@ struct amd_asf_dev { struct i2c_adapter adap; + void __iomem *eoi_base; struct i2c_client *target; struct delayed_work work_buf; struct sb800_mmio_cfg mmio_cfg; @@ -299,6 +300,7 @@ static int amd_asf_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct amd_asf_dev *asf_dev; + struct resource *eoi_addr; int ret, irq; asf_dev = devm_kzalloc(dev, sizeof(*asf_dev), GFP_KERNEL); @@ -310,6 +312,21 @@ static int amd_asf_probe(struct platform_device *pdev) if (!asf_dev->port_addr) return dev_err_probe(dev, -EINVAL, "missing IO resources\n"); + /* + * The resource obtained via ACPI might not belong to the ASF device address space. Instead, + * it could be within other IP blocks of the ASIC, which are crucial for generating + * subsequent interrupts. Therefore, we avoid using devm_platform_ioremap_resource() and + * use platform_get_resource() and devm_ioremap() separately to prevent any address space + * conflicts. + */ + eoi_addr = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!eoi_addr) + return dev_err_probe(dev, -EINVAL, "missing MEM resources\n"); + + asf_dev->eoi_base = devm_ioremap(dev, eoi_addr->start, resource_size(eoi_addr)); + if (!asf_dev->eoi_base) + return dev_err_probe(dev, -EBUSY, "failed mapping IO region\n"); + ret = devm_delayed_work_autocancel(dev, &asf_dev->work_buf, amd_asf_process_target); if (ret) return dev_err_probe(dev, ret, "failed to create work queue\n"); From patchwork Mon Sep 23 08:04:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 830270 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE07C49630 for ; Mon, 23 Sep 2024 08:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078746; cv=fail; b=BIIOT4r3iATfPhGSGRUCtuIAV8cwwbU6Tr8xeuAwxqMWUgYNUW+AwLiPbHUC4az+R4IXOlU8LqcTkIOOQi7TNoQThQfL7XNCXvPg7CVZ/Uk9fGEXRk7+/QhdXOr/FbbPvkXFQrt4XvztcZPfSXMatFG2VNvKFYAYXVvoeU/GUFo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727078746; c=relaxed/simple; bh=5Hugl5wpLdyyRGxsQhfI2qbkvTf4hOFMQ6+CBbOCjSs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GNe9KKJV1/x0Y2VRkTe3iXLRFBux0wNx43otGMJNaH1nSr3EgsNRyHUYgzmf2hOj7FHJRVPN2jqBfwXvg54p2b1KadOhu22qeJnEkr7O6ahzPmNriI+m263fsrHq7tU+5n0kIC0NP/QV6RtUckp/X4ll+y9zPIyM8qNnKtDnqDo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=3haUl3IZ; arc=fail smtp.client-ip=40.107.244.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="3haUl3IZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y5pAUas4uMBPHl0u3vNs0qdZ9xAQwO/SPt2KL1v5Fj8u8YH532NCASPEH/Nmf3lLw7VnPSGxR28/2LdnJORqIt6SMqgh7vG3kliLrCE8+C58/sb/FBFtlWkU4Aoja2WLLRTjD+XEjbXH3D94GKBwbaQUhlzWd8C3F985LIdWtregtrx/igPFKmQLGgEIN+8P3yqvyu/SBuYTbAE5OUCZCX+zYpLVjKCmeP0S7Tl3kGuRBTkJ/+2lZtahs5elsKHo0x2Z8fHLGN/SsrcpTNZMwy7/Fo2ubwnW8ChuaWNBnsL0oMQJ/3JoJ2JmFCnkZdtpMThFVfw3P+LvHZyeQsJxRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=coRMp6Uf9IJg9qAgO3Fmn7/PsVS9ybJStmyYhoOmcA4=; b=P8vFmZqqdWF0Aoo4myH41pOhLstnZrEAq/Pu1hbp0QsVdHn5c3HEPvsOssPMNosA3Z5j/MTr98Idu31xl54W815M8IXGRXgN90Oz9zWAMfuO5aESQKuJJKiHncA3H9ffFiazKX+mPhzV+UIrA9+iMqcPhfZ5EqbrXuGjOvwLQurm6QxJDGWP0PlcUq74vHJCYj147b9LnBPteobfhohnx2eQ1JJrvxcTCw0pw4aTY4r2v+efOwWPdUQ3enCQGoAPWZaC6ZUM4CQ8q7lRI6EEhKtFSKzn5Qk4oQi2+XPlsPXtr2hKY9XG7RD4GS4jCt3HffflmEvbm28G2ahTABJeiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=coRMp6Uf9IJg9qAgO3Fmn7/PsVS9ybJStmyYhoOmcA4=; b=3haUl3IZ8Q4dhwgrfjVZIrb5SDEivX0tSN+7h/2uddGiqHIn073pBKXTeIBf7CeVMQmzmuXd2xMXtiZR2lGmcdjkkt8fOBrzejQEqjaaiI2IR/PV5xlKUJ5SKt2xo3V4+w184S/gPES9qowEfEBoIE2kRDNgyfYi4bub6nKk4gQ= Received: from CH2PR03CA0029.namprd03.prod.outlook.com (2603:10b6:610:59::39) by PH7PR12MB5831.namprd12.prod.outlook.com (2603:10b6:510:1d6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 08:05:40 +0000 Received: from CH2PEPF0000013D.namprd02.prod.outlook.com (2603:10b6:610:59:cafe::b3) by CH2PR03CA0029.outlook.office365.com (2603:10b6:610:59::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30 via Frontend Transport; Mon, 23 Sep 2024 08:05:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH2PEPF0000013D.mail.protection.outlook.com (10.167.244.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 08:05:40 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 23 Sep 2024 03:05:37 -0500 From: Shyam Sundar S K To: Jean Delvare , Andi Shyti CC: , , Andy Shevchenko , , Shyam Sundar S K Subject: [PATCH v7 8/8] MAINTAINERS: Add AMD ASF driver entry Date: Mon, 23 Sep 2024 13:34:01 +0530 Message-ID: <20240923080401.2167310-9-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> References: <20240923080401.2167310-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013D:EE_|PH7PR12MB5831:EE_ X-MS-Office365-Filtering-Correlation-Id: 485150e7-2546-4a9d-8097-08dcdba683ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: nxEzpJJ0F7UnlfP3SrJnC0OyRcuP83P4qgX0Rz2uCNcTifLMa0af/rF/kmCcXcq3rUh6tELD/7b2EzRU2BnT5etRdU+L79sree4YHsA2USvQf3WM6Pj1K7Eniqza+pyedfX13jF9V+fz9CBk7GCFOgPpLPUpwBSGNZuB4t+Y9C6IUEGDvqhi2dPYBkPVcs50TNb/ZjJMi2kc7lEt6KBBFQPozFWfNEAlYGDj7f+eOrv8tyx3gelt718ixFcwbpHa0cm47pok73/B2pNlrzjQUihDTi0W2enoG/PvqqZlrCiuwUhk32JM9w2ckXiI5lz3uWHNBZYS6Wn1lBzr/rJJW+j/J1/53yiP1MR6Q+L/3YxLxpChbPU4QEaiVRGQ5SSN1Q8MTBfv+qyyRHSeu7S1jW9G68eWCmt4UGPsIx5QsPqcZ9Gl9QKCJyzmqJRzfVni7jTdTJhqzKLeErD2lElcQGqr1jgGJ0wolxc/PrHs9wjrizHwf2He5FcGypLp3dU31/S7lYTyodARjjnQrxGNBnuMIRJXYHgvabCfdosZj7d9eaHZSbikUtAKu60ORXQJCGe0uvQ1zqHMO6eVCNgkD5y2V9NZijFGyDL0OvDKYlNHfz9IzposEgRjNL5tl4CKEKyWg21UVmN1LHnrO9CcXEGgfbaz1gyxw3CuEU4Z6rArLQmUTSBruY5Kr3CxQdzvUOKmH89vw/tuTtspfridaxcRifc4EKuT9hQmmOYXMpiDbDkm5jC25+uh/KKUX4zXE7pZFGVQNCyt02skwx49WbWSTPvVf5sltYgaG0+cySlW9vfdBGSOuqKB0ShJtia0Qf1y+i37Qljf9hz3qA6l9l5DSl5NdQaZb8uY5eC8a3yg0f7cm02ENycJvRLQuI5S3vIUbJCppq4bo1oAePPLOaufD9eC3VsYJDDUNte2iWDisz6/NjteEwpVjx561Cc38UOsvPrH4GL6IWphUJuNMYwQP9bCb7C2BpSihjQIEi/gUwuomQeyPD3SRJVPMEoh4IIDVVuP0ApJ03uIYNn/vtyvlUEa3qnP5LYKchSNFL6FLSA8IJvhuqs3lvH1A3JdkOyyyBLDBw2Bp318hIUSLXHtIFPqEhfrFE/X4gtVwPHYKZX5Fg6ZxysHpZzTRKLGTloujNq0GepHMifGK0ZqGER77HD4hbspaH7Y3MDqx4h83UfX3yW+Vd3K/en7Iyz3L8EWWqD2SIV2rEaSFZWH9Otn56rN5nGvfCKqHSRdivURa3BEuPeN/wJsttWkNX1bAXUknFbiN3clMhSqrtymaI2rOLMUVmofEDB9hUK4uVI0IxhEfdDA81H4CPyPC/IctVQoE/io3WLcR3mom3kk/KCPYI3C4xQ4kjU6YyoaeiVxu7g8/PmNKGDO6XMhLCPJl4wR/xYP321MJT7lXDqt4NSFtXndUBLrrNVgliwkteLXSoHD1s42jZQbcQ9x5GBd X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 08:05:40.3420 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 485150e7-2546-4a9d-8097-08dcdba683ed X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000013D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5831 Update the MAINTAINERS file with AMD ASF driver details. Signed-off-by: Shyam Sundar S K Acked-by: Andi Shyti --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e1765d39ae75..69bc0bea0527 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1101,6 +1101,12 @@ L: linux-i2c@vger.kernel.org S: Maintained F: drivers/i2c/busses/i2c-amd-mp2* +AMD ASF I2C DRIVER +M: Shyam Sundar S K +L: linux-i2c@vger.kernel.org +S: Supported +F: drivers/i2c/busses/i2c-amd-asf-plat.c + AMD PDS CORE DRIVER M: Shannon Nelson M: Brett Creeley