Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* |
| 3 | * AMD MP2 PCIe communication driver |
Basavaraj Natikar | f75203c | 2021-09-23 17:59:30 +0530 | [diff] [blame] | 4 | * Copyright 2020-2021 Advanced Micro Devices, Inc. |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 5 | * |
| 6 | * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
| 7 | * Sandeep Singh <Sandeep.singh@amd.com> |
Basavaraj Natikar | f75203c | 2021-09-23 17:59:30 +0530 | [diff] [blame] | 8 | * Basavaraj Natikar <Basavaraj.Natikar@amd.com> |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <linux/bitops.h> |
| 12 | #include <linux/delay.h> |
| 13 | #include <linux/dma-mapping.h> |
Hans de Goede | 25615e4 | 2021-01-28 13:12:19 +0100 | [diff] [blame] | 14 | #include <linux/dmi.h> |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 15 | #include <linux/interrupt.h> |
| 16 | #include <linux/io-64-nonatomic-lo-hi.h> |
Basavaraj Natikar | 173709f | 2021-08-02 19:33:38 +0530 | [diff] [blame] | 17 | #include <linux/iopoll.h> |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 18 | #include <linux/module.h> |
| 19 | #include <linux/slab.h> |
| 20 | |
| 21 | #include "amd_sfh_pcie.h" |
| 22 | |
| 23 | #define DRIVER_NAME "pcie_mp2_amd" |
| 24 | #define DRIVER_DESC "AMD(R) PCIe MP2 Communication Driver" |
| 25 | |
Sandeep Singh | 4b393f0 | 2020-10-28 14:30:10 +0530 | [diff] [blame] | 26 | #define ACEL_EN BIT(0) |
| 27 | #define GYRO_EN BIT(1) |
Hans de Goede | 952f7d1 | 2021-01-28 13:12:18 +0100 | [diff] [blame] | 28 | #define MAGNO_EN BIT(2) |
Basavaraj Natikar | 24a31ea | 2021-06-18 13:48:38 +0530 | [diff] [blame] | 29 | #define HPD_EN BIT(16) |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 30 | #define ALS_EN BIT(19) |
| 31 | |
Hans de Goede | 952f7d1 | 2021-01-28 13:12:18 +0100 | [diff] [blame] | 32 | static int sensor_mask_override = -1; |
| 33 | module_param_named(sensor_mask, sensor_mask_override, int, 0444); |
| 34 | MODULE_PARM_DESC(sensor_mask, "override the detected sensors mask"); |
| 35 | |
Basavaraj Natikar | 173709f | 2021-08-02 19:33:38 +0530 | [diff] [blame] | 36 | static int amd_sfh_wait_response_v2(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts) |
| 37 | { |
| 38 | union cmd_response cmd_resp; |
| 39 | |
Basavaraj Natikar | a7072c0 | 2022-01-31 22:48:32 +0530 | [diff] [blame] | 40 | /* Get response with status within a max of 1600 ms timeout */ |
Basavaraj Natikar | 173709f | 2021-08-02 19:33:38 +0530 | [diff] [blame] | 41 | if (!readl_poll_timeout(mp2->mmio + AMD_P2C_MSG(0), cmd_resp.resp, |
| 42 | (cmd_resp.response_v2.response == sensor_sts && |
| 43 | cmd_resp.response_v2.status == 0 && (sid == 0xff || |
Basavaraj Natikar | a7072c0 | 2022-01-31 22:48:32 +0530 | [diff] [blame] | 44 | cmd_resp.response_v2.sensor_id == sid)), 500, 1600000)) |
Basavaraj Natikar | 173709f | 2021-08-02 19:33:38 +0530 | [diff] [blame] | 45 | return cmd_resp.response_v2.response; |
| 46 | |
| 47 | return SENSOR_DISABLED; |
| 48 | } |
| 49 | |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 50 | static void amd_start_sensor_v2(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) |
| 51 | { |
| 52 | union sfh_cmd_base cmd_base; |
| 53 | |
| 54 | cmd_base.ul = 0; |
| 55 | cmd_base.cmd_v2.cmd_id = ENABLE_SENSOR; |
Basavaraj Natikar | b300667 | 2022-02-08 17:51:10 +0530 | [diff] [blame^] | 56 | cmd_base.cmd_v2.intr_disable = 1; |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 57 | cmd_base.cmd_v2.period = info.period; |
| 58 | cmd_base.cmd_v2.sensor_id = info.sensor_idx; |
| 59 | cmd_base.cmd_v2.length = 16; |
| 60 | |
| 61 | if (info.sensor_idx == als_idx) |
| 62 | cmd_base.cmd_v2.mem_type = USE_C2P_REG; |
| 63 | |
| 64 | writeq(info.dma_address, privdata->mmio + AMD_C2P_MSG1); |
| 65 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 66 | } |
| 67 | |
| 68 | static void amd_stop_sensor_v2(struct amd_mp2_dev *privdata, u16 sensor_idx) |
| 69 | { |
| 70 | union sfh_cmd_base cmd_base; |
| 71 | |
| 72 | cmd_base.ul = 0; |
| 73 | cmd_base.cmd_v2.cmd_id = DISABLE_SENSOR; |
Basavaraj Natikar | b300667 | 2022-02-08 17:51:10 +0530 | [diff] [blame^] | 74 | cmd_base.cmd_v2.intr_disable = 1; |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 75 | cmd_base.cmd_v2.period = 0; |
| 76 | cmd_base.cmd_v2.sensor_id = sensor_idx; |
| 77 | cmd_base.cmd_v2.length = 16; |
| 78 | |
Dylan MacKenzie | 8aa6348 | 2021-07-13 16:31:07 -0700 | [diff] [blame] | 79 | writeq(0x0, privdata->mmio + AMD_C2P_MSG1); |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 80 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 81 | } |
| 82 | |
| 83 | static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata) |
| 84 | { |
| 85 | union sfh_cmd_base cmd_base; |
| 86 | |
| 87 | cmd_base.cmd_v2.cmd_id = STOP_ALL_SENSORS; |
Basavaraj Natikar | b300667 | 2022-02-08 17:51:10 +0530 | [diff] [blame^] | 88 | cmd_base.cmd_v2.intr_disable = 1; |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 89 | cmd_base.cmd_v2.period = 0; |
| 90 | cmd_base.cmd_v2.sensor_id = 0; |
| 91 | |
| 92 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 93 | } |
| 94 | |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 95 | void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) |
| 96 | { |
| 97 | union sfh_cmd_param cmd_param; |
| 98 | union sfh_cmd_base cmd_base; |
| 99 | |
| 100 | /* fill up command register */ |
| 101 | memset(&cmd_base, 0, sizeof(cmd_base)); |
| 102 | cmd_base.s.cmd_id = ENABLE_SENSOR; |
| 103 | cmd_base.s.period = info.period; |
| 104 | cmd_base.s.sensor_id = info.sensor_idx; |
| 105 | |
| 106 | /* fill up command param register */ |
| 107 | memset(&cmd_param, 0, sizeof(cmd_param)); |
| 108 | cmd_param.s.buf_layout = 1; |
| 109 | cmd_param.s.buf_length = 16; |
| 110 | |
Arnd Bergmann | de30491 | 2021-01-03 14:53:55 +0100 | [diff] [blame] | 111 | writeq(info.dma_address, privdata->mmio + AMD_C2P_MSG2); |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 112 | writel(cmd_param.ul, privdata->mmio + AMD_C2P_MSG1); |
| 113 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 114 | } |
| 115 | |
| 116 | void amd_stop_sensor(struct amd_mp2_dev *privdata, u16 sensor_idx) |
| 117 | { |
| 118 | union sfh_cmd_base cmd_base; |
| 119 | |
| 120 | /* fill up command register */ |
| 121 | memset(&cmd_base, 0, sizeof(cmd_base)); |
| 122 | cmd_base.s.cmd_id = DISABLE_SENSOR; |
| 123 | cmd_base.s.period = 0; |
| 124 | cmd_base.s.sensor_id = sensor_idx; |
| 125 | |
| 126 | writeq(0x0, privdata->mmio + AMD_C2P_MSG2); |
| 127 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 128 | } |
| 129 | |
| 130 | void amd_stop_all_sensors(struct amd_mp2_dev *privdata) |
| 131 | { |
| 132 | union sfh_cmd_base cmd_base; |
| 133 | |
| 134 | /* fill up command register */ |
| 135 | memset(&cmd_base, 0, sizeof(cmd_base)); |
| 136 | cmd_base.s.cmd_id = STOP_ALL_SENSORS; |
| 137 | cmd_base.s.period = 0; |
| 138 | cmd_base.s.sensor_id = 0; |
| 139 | |
| 140 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 141 | } |
| 142 | |
Hans de Goede | 25615e4 | 2021-01-28 13:12:19 +0100 | [diff] [blame] | 143 | static const struct dmi_system_id dmi_sensor_mask_overrides[] = { |
| 144 | { |
| 145 | .matches = { |
| 146 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 13-ag0xxx"), |
| 147 | }, |
| 148 | .driver_data = (void *)(ACEL_EN | MAGNO_EN), |
| 149 | }, |
| 150 | { |
| 151 | .matches = { |
| 152 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 15-cp0xxx"), |
| 153 | }, |
| 154 | .driver_data = (void *)(ACEL_EN | MAGNO_EN), |
| 155 | }, |
| 156 | { } |
| 157 | }; |
| 158 | |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 159 | int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id) |
| 160 | { |
| 161 | int activestatus, num_of_sensors = 0; |
Hans de Goede | 25615e4 | 2021-01-28 13:12:19 +0100 | [diff] [blame] | 162 | const struct dmi_system_id *dmi_id; |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 163 | |
Hans de Goede | 25615e4 | 2021-01-28 13:12:19 +0100 | [diff] [blame] | 164 | if (sensor_mask_override == -1) { |
| 165 | dmi_id = dmi_first_match(dmi_sensor_mask_overrides); |
| 166 | if (dmi_id) |
| 167 | sensor_mask_override = (long)dmi_id->driver_data; |
| 168 | } |
| 169 | |
Hans de Goede | 952f7d1 | 2021-01-28 13:12:18 +0100 | [diff] [blame] | 170 | if (sensor_mask_override >= 0) { |
| 171 | activestatus = sensor_mask_override; |
| 172 | } else { |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 173 | activestatus = privdata->mp2_acs >> 4; |
Hans de Goede | 952f7d1 | 2021-01-28 13:12:18 +0100 | [diff] [blame] | 174 | } |
Hans de Goede | a9e54f4 | 2021-01-28 13:12:17 +0100 | [diff] [blame] | 175 | |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 176 | if (ACEL_EN & activestatus) |
| 177 | sensor_id[num_of_sensors++] = accel_idx; |
| 178 | |
| 179 | if (GYRO_EN & activestatus) |
| 180 | sensor_id[num_of_sensors++] = gyro_idx; |
| 181 | |
| 182 | if (MAGNO_EN & activestatus) |
| 183 | sensor_id[num_of_sensors++] = mag_idx; |
| 184 | |
| 185 | if (ALS_EN & activestatus) |
| 186 | sensor_id[num_of_sensors++] = als_idx; |
| 187 | |
Basavaraj Natikar | 24a31ea | 2021-06-18 13:48:38 +0530 | [diff] [blame] | 188 | if (HPD_EN & activestatus) |
| 189 | sensor_id[num_of_sensors++] = HPD_IDX; |
| 190 | |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 191 | return num_of_sensors; |
| 192 | } |
| 193 | |
| 194 | static void amd_mp2_pci_remove(void *privdata) |
| 195 | { |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 196 | struct amd_mp2_dev *mp2 = privdata; |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 197 | amd_sfh_hid_client_deinit(privdata); |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 198 | mp2->mp2_ops->stop_all(mp2); |
| 199 | } |
| 200 | |
| 201 | static const struct amd_mp2_ops amd_sfh_ops_v2 = { |
| 202 | .start = amd_start_sensor_v2, |
| 203 | .stop = amd_stop_sensor_v2, |
| 204 | .stop_all = amd_stop_all_sensor_v2, |
Basavaraj Natikar | 173709f | 2021-08-02 19:33:38 +0530 | [diff] [blame] | 205 | .response = amd_sfh_wait_response_v2, |
Basavaraj Natikar | f264481 | 2021-06-18 13:48:36 +0530 | [diff] [blame] | 206 | }; |
| 207 | |
| 208 | static const struct amd_mp2_ops amd_sfh_ops = { |
| 209 | .start = amd_start_sensor, |
| 210 | .stop = amd_stop_sensor, |
| 211 | .stop_all = amd_stop_all_sensors, |
| 212 | }; |
| 213 | |
| 214 | static void mp2_select_ops(struct amd_mp2_dev *privdata) |
| 215 | { |
| 216 | u8 acs; |
| 217 | |
| 218 | privdata->mp2_acs = readl(privdata->mmio + AMD_P2C_MSG3); |
| 219 | acs = privdata->mp2_acs & GENMASK(3, 0); |
| 220 | |
| 221 | switch (acs) { |
| 222 | case V2_STATUS: |
| 223 | privdata->mp2_ops = &amd_sfh_ops_v2; |
| 224 | break; |
| 225 | default: |
| 226 | privdata->mp2_ops = &amd_sfh_ops; |
| 227 | break; |
| 228 | } |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
| 232 | { |
| 233 | struct amd_mp2_dev *privdata; |
| 234 | int rc; |
| 235 | |
| 236 | privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL); |
| 237 | if (!privdata) |
| 238 | return -ENOMEM; |
| 239 | |
| 240 | privdata->pdev = pdev; |
Basavaraj Natikar | ba70a4f | 2021-09-23 17:59:29 +0530 | [diff] [blame] | 241 | dev_set_drvdata(&pdev->dev, privdata); |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 242 | rc = pcim_enable_device(pdev); |
| 243 | if (rc) |
| 244 | return rc; |
| 245 | |
| 246 | rc = pcim_iomap_regions(pdev, BIT(2), DRIVER_NAME); |
| 247 | if (rc) |
| 248 | return rc; |
| 249 | |
| 250 | privdata->mmio = pcim_iomap_table(pdev)[2]; |
| 251 | pci_set_master(pdev); |
Basavaraj Natikar | c45d2b5 | 2021-09-23 17:59:28 +0530 | [diff] [blame] | 252 | rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 253 | if (rc) { |
Basavaraj Natikar | c45d2b5 | 2021-09-23 17:59:28 +0530 | [diff] [blame] | 254 | rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
| 255 | if (rc) { |
| 256 | dev_err(&pdev->dev, "failed to set DMA mask\n"); |
| 257 | return rc; |
| 258 | } |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 259 | } |
Basavaraj Natikar | 0aad9c9 | 2021-06-18 13:48:37 +0530 | [diff] [blame] | 260 | |
| 261 | privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL); |
| 262 | if (!privdata->cl_data) |
| 263 | return -ENOMEM; |
| 264 | |
Basavaraj Natikar | 88a0404 | 2021-09-23 17:59:27 +0530 | [diff] [blame] | 265 | mp2_select_ops(privdata); |
| 266 | |
| 267 | rc = amd_sfh_hid_client_init(privdata); |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 268 | if (rc) |
| 269 | return rc; |
| 270 | |
Basavaraj Natikar | 88a0404 | 2021-09-23 17:59:27 +0530 | [diff] [blame] | 271 | return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata); |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 272 | } |
| 273 | |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 274 | static int __maybe_unused amd_mp2_pci_resume(struct device *dev) |
| 275 | { |
Basavaraj Natikar | ba70a4f | 2021-09-23 17:59:29 +0530 | [diff] [blame] | 276 | struct amd_mp2_dev *mp2 = dev_get_drvdata(dev); |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 277 | struct amdtp_cl_data *cl_data = mp2->cl_data; |
| 278 | struct amd_mp2_sensor_info info; |
| 279 | int i, status; |
| 280 | |
| 281 | for (i = 0; i < cl_data->num_hid_devices; i++) { |
| 282 | if (cl_data->sensor_sts[i] == SENSOR_DISABLED) { |
| 283 | info.period = AMD_SFH_IDLE_LOOP; |
| 284 | info.sensor_idx = cl_data->sensor_idx[i]; |
| 285 | info.dma_address = cl_data->sensor_dma_addr[i]; |
| 286 | mp2->mp2_ops->start(mp2, info); |
| 287 | status = amd_sfh_wait_for_response |
| 288 | (mp2, cl_data->sensor_idx[i], SENSOR_ENABLED); |
| 289 | if (status == SENSOR_ENABLED) |
| 290 | cl_data->sensor_sts[i] = SENSOR_ENABLED; |
Basavaraj Natikar | e665775 | 2021-08-02 19:33:41 +0530 | [diff] [blame] | 291 | dev_dbg(dev, "resume sid 0x%x status 0x%x\n", |
| 292 | cl_data->sensor_idx[i], cl_data->sensor_sts[i]); |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 293 | } |
| 294 | } |
| 295 | |
Basavaraj Natikar | 0cf7423 | 2022-02-08 17:51:08 +0530 | [diff] [blame] | 296 | schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP)); |
| 297 | |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 298 | return 0; |
| 299 | } |
| 300 | |
| 301 | static int __maybe_unused amd_mp2_pci_suspend(struct device *dev) |
| 302 | { |
Basavaraj Natikar | ba70a4f | 2021-09-23 17:59:29 +0530 | [diff] [blame] | 303 | struct amd_mp2_dev *mp2 = dev_get_drvdata(dev); |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 304 | struct amdtp_cl_data *cl_data = mp2->cl_data; |
| 305 | int i, status; |
| 306 | |
| 307 | for (i = 0; i < cl_data->num_hid_devices; i++) { |
| 308 | if (cl_data->sensor_idx[i] != HPD_IDX && |
| 309 | cl_data->sensor_sts[i] == SENSOR_ENABLED) { |
| 310 | mp2->mp2_ops->stop(mp2, cl_data->sensor_idx[i]); |
| 311 | status = amd_sfh_wait_for_response |
| 312 | (mp2, cl_data->sensor_idx[i], SENSOR_DISABLED); |
| 313 | if (status != SENSOR_ENABLED) |
| 314 | cl_data->sensor_sts[i] = SENSOR_DISABLED; |
Basavaraj Natikar | e665775 | 2021-08-02 19:33:41 +0530 | [diff] [blame] | 315 | dev_dbg(dev, "suspend sid 0x%x status 0x%x\n", |
| 316 | cl_data->sensor_idx[i], cl_data->sensor_sts[i]); |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 317 | } |
| 318 | } |
| 319 | |
Basavaraj Natikar | 0cf7423 | 2022-02-08 17:51:08 +0530 | [diff] [blame] | 320 | cancel_delayed_work_sync(&cl_data->work_buffer); |
| 321 | |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 322 | return 0; |
| 323 | } |
| 324 | |
| 325 | static SIMPLE_DEV_PM_OPS(amd_mp2_pm_ops, amd_mp2_pci_suspend, |
| 326 | amd_mp2_pci_resume); |
| 327 | |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 328 | static const struct pci_device_id amd_mp2_pci_tbl[] = { |
| 329 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_MP2) }, |
| 330 | { } |
| 331 | }; |
| 332 | MODULE_DEVICE_TABLE(pci, amd_mp2_pci_tbl); |
| 333 | |
| 334 | static struct pci_driver amd_mp2_pci_driver = { |
| 335 | .name = DRIVER_NAME, |
| 336 | .id_table = amd_mp2_pci_tbl, |
| 337 | .probe = amd_mp2_pci_probe, |
Basavaraj Natikar | 0873d1a | 2021-08-02 19:33:40 +0530 | [diff] [blame] | 338 | .driver.pm = &amd_mp2_pm_ops, |
Sandeep Singh | 4f567b9 | 2020-10-10 01:31:36 +0530 | [diff] [blame] | 339 | }; |
| 340 | module_pci_driver(amd_mp2_pci_driver); |
| 341 | |
| 342 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 343 | MODULE_LICENSE("Dual BSD/GPL"); |
| 344 | MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>"); |
| 345 | MODULE_AUTHOR("Sandeep Singh <Sandeep.singh@amd.com>"); |
Basavaraj Natikar | f75203c | 2021-09-23 17:59:30 +0530 | [diff] [blame] | 346 | MODULE_AUTHOR("Basavaraj Natikar <Basavaraj.Natikar@amd.com>"); |