Re: [PATCH v5 8/9] PCI: pwrctrl: Add power control driver for tc9563

From: kernel test robot
Date: Tue Apr 15 2025 - 04:45:23 EST


Hi Krishna,

kernel test robot noticed the following build errors:

[auto build test ERROR on f4d2ef48250ad057e4f00087967b5ff366da9f39]

url: https://github.com/intel-lab-lkp/linux/commits/Krishna-Chaitanya-Chundru/dt-bindings-PCI-Add-binding-for-Toshiba-TC9563-PCIe-switch/20250414-123816
base: f4d2ef48250ad057e4f00087967b5ff366da9f39
patch link: https://lore.kernel.org/r/20250412-qps615_v4_1-v5-8-5b6a06132fec%40oss.qualcomm.com
patch subject: [PATCH v5 8/9] PCI: pwrctrl: Add power control driver for tc9563
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250415/202504151632.tCoey9d8-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250415/202504151632.tCoey9d8-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504151632.tCoey9d8-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c:419:2: error: call to undeclared function 'gpiod_set_value'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
419 | gpiod_set_value(ctx->reset_gpio, 1);
| ^
drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c:433:2: error: call to undeclared function 'gpiod_set_value'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
433 | gpiod_set_value(ctx->reset_gpio, 0);
| ^
>> drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c:535:20: error: call to undeclared function 'devm_gpiod_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
535 | ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
| ^
>> drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c:535:49: error: use of undeclared identifier 'GPIOD_OUT_HIGH'
535 | ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
| ^
4 errors generated.


vim +/gpiod_set_value +419 drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c

416
417 static void tc9563_pwrctrl_power_off(struct tc9563_pwrctrl_ctx *ctx)
418 {
> 419 gpiod_set_value(ctx->reset_gpio, 1);
420
421 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
422 }
423
424 static int tc9563_pwrctrl_bring_up(struct tc9563_pwrctrl_ctx *ctx)
425 {
426 struct tc9563_pwrctrl_cfg *cfg;
427 int ret, i;
428
429 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
430 if (ret < 0)
431 return dev_err_probe(ctx->pwrctrl.dev, ret, "cannot enable regulators\n");
432
433 gpiod_set_value(ctx->reset_gpio, 0);
434
435 /* wait for the internal osc frequency to stablise */
436 usleep_range(10000, 10500);
437
438 ret = tc9563_pwrctrl_assert_deassert_reset(ctx, false);
439 if (ret)
440 goto power_off;
441
442 for (i = 0; i < TC9563_MAX; i++) {
443 cfg = &ctx->cfg[i];
444 ret = tc9563_pwrctrl_disable_port(ctx, i);
445 if (ret) {
446 dev_err(ctx->pwrctrl.dev, "Disabling port failed\n");
447 goto power_off;
448 }
449
450 ret = tc9563_pwrctrl_set_l0s_l1_entry_delay(ctx, i, false, cfg->l0s_delay);
451 if (ret) {
452 dev_err(ctx->pwrctrl.dev, "Setting L0s entry delay failed\n");
453 goto power_off;
454 }
455
456 ret = tc9563_pwrctrl_set_l0s_l1_entry_delay(ctx, i, true, cfg->l1_delay);
457 if (ret) {
458 dev_err(ctx->pwrctrl.dev, "Setting L1 entry delay failed\n");
459 goto power_off;
460 }
461
462 ret = tc9563_pwrctrl_set_tx_amplitude(ctx, i, cfg->tx_amp);
463 if (ret) {
464 dev_err(ctx->pwrctrl.dev, "Setting Tx amplitube failed\n");
465 goto power_off;
466 }
467
468 ret = tc9563_pwrctrl_set_nfts(ctx, i, cfg->nfts);
469 if (ret) {
470 dev_err(ctx->pwrctrl.dev, "Setting nfts failed\n");
471 goto power_off;
472 }
473
474 ret = tc9563_pwrctrl_disable_dfe(ctx, i);
475 if (ret) {
476 dev_err(ctx->pwrctrl.dev, "Disabling DFE failed\n");
477 goto power_off;
478 }
479 }
480
481 ret = tc9563_pwrctrl_assert_deassert_reset(ctx, true);
482 if (!ret)
483 return 0;
484
485 power_off:
486 tc9563_pwrctrl_power_off(ctx);
487 return ret;
488 }
489
490 static int tc9563_pwrctrl_probe(struct platform_device *pdev)
491 {
492 struct pci_host_bridge *bridge = to_pci_host_bridge(pdev->dev.parent);
493 struct pci_dev *pci_dev = to_pci_dev(pdev->dev.parent);
494 struct pci_bus *bus = bridge->bus;
495 struct device *dev = &pdev->dev;
496 enum tc9563_pwrctrl_ports port;
497 struct tc9563_pwrctrl_ctx *ctx;
498 struct device_node *i2c_node;
499 int ret, addr;
500
501 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
502 if (!ctx)
503 return -ENOMEM;
504
505 ret = of_property_read_u32_index(pdev->dev.of_node, "i2c-parent", 1, &addr);
506 if (ret)
507 return dev_err_probe(dev, ret, "Failed to read i2c-parent property\n");
508
509 i2c_node = of_parse_phandle(dev->of_node, "i2c-parent", 0);
510 ctx->adapter = of_find_i2c_adapter_by_node(i2c_node);
511 of_node_put(i2c_node);
512 if (!ctx->adapter)
513 return dev_err_probe(dev, -EPROBE_DEFER, "Failed to find I2C adapter\n");
514
515 ctx->client = i2c_new_dummy_device(ctx->adapter, addr);
516 if (IS_ERR(ctx->client)) {
517 dev_err(dev, "Failed to create I2C client\n");
518 i2c_put_adapter(ctx->adapter);
519 return PTR_ERR(ctx->client);
520 }
521
522 ctx->supplies[0].supply = "vddc";
523 ctx->supplies[1].supply = "vdd18";
524 ctx->supplies[2].supply = "vdd09";
525 ctx->supplies[3].supply = "vddio1";
526 ctx->supplies[4].supply = "vddio2";
527 ctx->supplies[5].supply = "vddio18";
528 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ctx->supplies);
529 if (ret) {
530 dev_err_probe(dev, ret,
531 "failed to get supply regulator\n");
532 goto remove_i2c;
533 }
534
> 535 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
536 if (IS_ERR(ctx->reset_gpio)) {
537 ret = dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "failed to get reset GPIO\n");
538 goto remove_i2c;
539 }
540
541 pci_pwrctrl_init(&ctx->pwrctrl, dev);
542
543 port = TC9563_USP;
544 ret = tc9563_pwrctrl_parse_device_dt(ctx, pdev->dev.of_node, port);
545 if (ret) {
546 dev_err(dev, "failed to parse device tree properties: %d\n", ret);
547 goto remove_i2c;
548 }
549
550 /*
551 * Downstream ports are always children of the upstream port.
552 * The first node represents DSP1, the second node represents DSP2, and so on.
553 */
554 for_each_child_of_node_scoped(pdev->dev.of_node, child) {
555 ret = tc9563_pwrctrl_parse_device_dt(ctx, child, port++);
556 if (ret)
557 break;
558 /* Embedded ethernet device are under DSP3 */
559 if (port == TC9563_DSP3)
560 for_each_child_of_node_scoped(child, child1) {
561 ret = tc9563_pwrctrl_parse_device_dt(ctx, child1, port++);
562 if (ret)
563 break;
564 }
565 }
566 if (ret) {
567 dev_err(dev, "failed to parse device tree properties: %d\n", ret);
568 goto remove_i2c;
569 }
570
571 if (!pcie_link_is_active(pci_dev) && bridge->ops->stop_link)
572 bridge->ops->stop_link(bus);
573
574 ret = tc9563_pwrctrl_bring_up(ctx);
575 if (ret)
576 goto remove_i2c;
577
578 if (!pcie_link_is_active(pci_dev) && bridge->ops->start_link) {
579 ret = bridge->ops->start_link(bus);
580 if (ret)
581 goto power_off;
582 }
583
584 ret = devm_pci_pwrctrl_device_set_ready(dev, &ctx->pwrctrl);
585 if (ret)
586 goto power_off;
587
588 platform_set_drvdata(pdev, ctx);
589
590 return 0;
591
592 power_off:
593 tc9563_pwrctrl_power_off(ctx);
594 remove_i2c:
595 i2c_unregister_device(ctx->client);
596 i2c_put_adapter(ctx->adapter);
597 return ret;
598 }
599

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki