Merge branch 'for-5.16/amd-sfh' into for-linus

- code cleanups (Basavaraj Natikar, Christophe JAILLET)
This commit is contained in:
Jiri Kosina 2021-11-05 12:08:34 +01:00
commit a6e757e3a1
8 changed files with 26 additions and 14 deletions

View File

@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* AMD SFH Client Layer
* Copyright 2020 Advanced Micro Devices, Inc.
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
* Sandeep Singh <Sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#include <linux/dma-mapping.h>

View File

@ -2,8 +2,10 @@
/*
* AMD MP2 Sensors transport driver
*
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
* Sandeep Singh <sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#include <linux/hid.h>
#include <linux/wait.h>

View File

@ -2,8 +2,10 @@
/*
* AMD MP2 Sensors transport driver
*
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
* Sandeep Singh <sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#ifndef AMDSFH_HID_H

View File

@ -1,10 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* AMD MP2 PCIe communication driver
* Copyright 2020 Advanced Micro Devices, Inc.
* Copyright 2020-2021 Advanced Micro Devices, Inc.
*
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
* Sandeep Singh <Sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#include <linux/bitops.h>
@ -234,7 +235,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
return -ENOMEM;
privdata->pdev = pdev;
pci_set_drvdata(pdev, privdata);
dev_set_drvdata(&pdev->dev, privdata);
rc = pcim_enable_device(pdev);
if (rc)
return rc;
@ -245,10 +246,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
privdata->mmio = pcim_iomap_table(pdev)[2];
pci_set_master(pdev);
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (rc) {
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
return rc;
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (rc) {
dev_err(&pdev->dev, "failed to set DMA mask\n");
return rc;
}
}
privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL);
@ -266,8 +270,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
struct amdtp_cl_data *cl_data = mp2->cl_data;
struct amd_mp2_sensor_info info;
int i, status;
@ -292,8 +295,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
struct amdtp_cl_data *cl_data = mp2->cl_data;
int i, status;
@ -334,3 +336,4 @@ MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>");
MODULE_AUTHOR("Sandeep Singh <Sandeep.singh@amd.com>");
MODULE_AUTHOR("Basavaraj Natikar <Basavaraj.Natikar@amd.com>");

View File

@ -1,9 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* AMD MP2 PCIe communication driver
* Copyright 2020 Advanced Micro Devices, Inc.
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
* Sandeep Singh <Sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#ifndef PCIE_MP2_AMD_H

View File

@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* AMD SFH Report Descriptor generator
* Copyright 2020 Advanced Micro Devices, Inc.
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
* Sandeep Singh <sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#include <linux/kernel.h>

View File

@ -1,9 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* HID report descriptors, structures and routines
* Copyright 2020 Advanced Micro Devices, Inc.
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
* Sandeep Singh <Sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#ifndef AMD_SFH_HID_DESCRIPTOR_H

View File

@ -1,9 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* HID descriptor stuructures
* Copyright 2020 Advanced Micro Devices, Inc.
* Copyright 2020-2021 Advanced Micro Devices, Inc.
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
* Sandeep Singh <Sandeep.singh@amd.com>
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
*/
#ifndef AMD_SFH_HID_REPORT_DESCRIPTOR_H