.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Intel Atom SOC Power Management Controller Driver |
---|
3 | 4 | * Copyright (c) 2014, Intel Corporation. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms and conditions of the GNU General Public License, |
---|
7 | | - * version 2, as published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | 5 | */ |
---|
15 | 6 | |
---|
16 | 7 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
253 | 244 | pm1_cnt_port = acpi_base_addr + PM1_CNT; |
---|
254 | 245 | |
---|
255 | 246 | pm1_cnt_value = inl(pm1_cnt_port); |
---|
256 | | - pm1_cnt_value &= SLEEP_TYPE_MASK; |
---|
| 247 | + pm1_cnt_value &= ~SLEEP_TYPE_MASK; |
---|
257 | 248 | pm1_cnt_value |= SLEEP_TYPE_S5; |
---|
258 | 249 | pm1_cnt_value |= SLEEP_ENABLE; |
---|
259 | 250 | |
---|
.. | .. |
---|
350 | 341 | |
---|
351 | 342 | DEFINE_SHOW_ATTRIBUTE(pmc_sleep_tmr); |
---|
352 | 343 | |
---|
353 | | -static void pmc_dbgfs_unregister(struct pmc_dev *pmc) |
---|
| 344 | +static void pmc_dbgfs_register(struct pmc_dev *pmc) |
---|
354 | 345 | { |
---|
355 | | - debugfs_remove_recursive(pmc->dbgfs_dir); |
---|
356 | | -} |
---|
357 | | - |
---|
358 | | -static int pmc_dbgfs_register(struct pmc_dev *pmc) |
---|
359 | | -{ |
---|
360 | | - struct dentry *dir, *f; |
---|
| 346 | + struct dentry *dir; |
---|
361 | 347 | |
---|
362 | 348 | dir = debugfs_create_dir("pmc_atom", NULL); |
---|
363 | | - if (!dir) |
---|
364 | | - return -ENOMEM; |
---|
365 | 349 | |
---|
366 | 350 | pmc->dbgfs_dir = dir; |
---|
367 | 351 | |
---|
368 | | - f = debugfs_create_file("dev_state", S_IFREG | S_IRUGO, |
---|
369 | | - dir, pmc, &pmc_dev_state_fops); |
---|
370 | | - if (!f) |
---|
371 | | - goto err; |
---|
372 | | - |
---|
373 | | - f = debugfs_create_file("pss_state", S_IFREG | S_IRUGO, |
---|
374 | | - dir, pmc, &pmc_pss_state_fops); |
---|
375 | | - if (!f) |
---|
376 | | - goto err; |
---|
377 | | - |
---|
378 | | - f = debugfs_create_file("sleep_state", S_IFREG | S_IRUGO, |
---|
379 | | - dir, pmc, &pmc_sleep_tmr_fops); |
---|
380 | | - if (!f) |
---|
381 | | - goto err; |
---|
382 | | - |
---|
383 | | - return 0; |
---|
384 | | -err: |
---|
385 | | - pmc_dbgfs_unregister(pmc); |
---|
386 | | - return -ENODEV; |
---|
| 352 | + debugfs_create_file("dev_state", S_IFREG | S_IRUGO, dir, pmc, |
---|
| 353 | + &pmc_dev_state_fops); |
---|
| 354 | + debugfs_create_file("pss_state", S_IFREG | S_IRUGO, dir, pmc, |
---|
| 355 | + &pmc_pss_state_fops); |
---|
| 356 | + debugfs_create_file("sleep_state", S_IFREG | S_IRUGO, dir, pmc, |
---|
| 357 | + &pmc_sleep_tmr_fops); |
---|
387 | 358 | } |
---|
388 | 359 | #else |
---|
389 | | -static int pmc_dbgfs_register(struct pmc_dev *pmc) |
---|
| 360 | +static void pmc_dbgfs_register(struct pmc_dev *pmc) |
---|
390 | 361 | { |
---|
391 | | - return 0; |
---|
392 | 362 | } |
---|
393 | 363 | #endif /* CONFIG_DEBUG_FS */ |
---|
394 | 364 | |
---|
.. | .. |
---|
434 | 404 | .matches = { |
---|
435 | 405 | DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"), |
---|
436 | 406 | DMI_MATCH(DMI_PRODUCT_VERSION, "6ES7647-8B"), |
---|
| 407 | + }, |
---|
| 408 | + }, |
---|
| 409 | + { |
---|
| 410 | + .ident = "SIMATIC IPC277E", |
---|
| 411 | + .matches = { |
---|
| 412 | + DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"), |
---|
| 413 | + DMI_MATCH(DMI_PRODUCT_VERSION, "6AV7882-0"), |
---|
437 | 414 | }, |
---|
438 | 415 | }, |
---|
439 | 416 | { |
---|
.. | .. |
---|
496 | 473 | pci_read_config_dword(pdev, PMC_BASE_ADDR_OFFSET, &pmc->base_addr); |
---|
497 | 474 | pmc->base_addr &= PMC_BASE_ADDR_MASK; |
---|
498 | 475 | |
---|
499 | | - pmc->regmap = ioremap_nocache(pmc->base_addr, PMC_MMIO_REG_LEN); |
---|
| 476 | + pmc->regmap = ioremap(pmc->base_addr, PMC_MMIO_REG_LEN); |
---|
500 | 477 | if (!pmc->regmap) { |
---|
501 | 478 | dev_err(&pdev->dev, "error: ioremap failed\n"); |
---|
502 | 479 | return -ENOMEM; |
---|
.. | .. |
---|
507 | 484 | /* PMC hardware registers setup */ |
---|
508 | 485 | pmc_hw_reg_setup(pmc); |
---|
509 | 486 | |
---|
510 | | - ret = pmc_dbgfs_register(pmc); |
---|
511 | | - if (ret) |
---|
512 | | - dev_warn(&pdev->dev, "debugfs register failed\n"); |
---|
| 487 | + pmc_dbgfs_register(pmc); |
---|
513 | 488 | |
---|
514 | 489 | /* Register platform clocks - PMC_PLT_CLK [0..5] */ |
---|
515 | 490 | ret = pmc_setup_clks(pdev, pmc->regmap, data); |
---|