gpio-merrifield.c (82ffd0454bd9bd57780966d47bfd56d579dd4fb3) gpio-merrifield.c (d00d2109c3679bf87d412b1667bcb6d42c1ac12f)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Intel Merrifield SoC GPIO driver
4 *
5 * Copyright (c) 2016 Intel Corporation.
6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 */
8

--- 363 unchanged lines hidden (view full) ---

372 reg = gpio_reg(&priv->chip, base, GRER);
373 writel(0, reg);
374 /* Clear the falling-edge detect register */
375 reg = gpio_reg(&priv->chip, base, GFER);
376 writel(0, reg);
377 }
378}
379
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Intel Merrifield SoC GPIO driver
4 *
5 * Copyright (c) 2016 Intel Corporation.
6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7 */
8

--- 363 unchanged lines hidden (view full) ---

372 reg = gpio_reg(&priv->chip, base, GRER);
373 writel(0, reg);
374 /* Clear the falling-edge detect register */
375 reg = gpio_reg(&priv->chip, base, GFER);
376 writel(0, reg);
377 }
378}
379
380static const char *mrfld_gpio_get_pinctrl_dev_name(void)
380static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
381{
381{
382 const char *dev_name = acpi_dev_get_first_match_name("INTC1002", NULL, -1);
383 return dev_name ? dev_name : "pinctrl-merrifield";
382 struct acpi_device *adev;
383 const char *name;
384
385 adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1);
386 if (adev) {
387 name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL);
388 put_device(&adev->dev);
389 } else {
390 name = "pinctrl-merrifield";
391 }
392
393 return name;
384}
385
386static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id)
387{
388 const struct mrfld_gpio_pinrange *range;
389 const char *pinctrl_dev_name;
390 struct mrfld_gpio *priv;
391 u32 gpio_base, irq_base;

--- 44 unchanged lines hidden (view full) ---

436
437 pci_set_drvdata(pdev, priv);
438 retval = devm_gpiochip_add_data(&pdev->dev, &priv->chip, priv);
439 if (retval) {
440 dev_err(&pdev->dev, "gpiochip_add error %d\n", retval);
441 return retval;
442 }
443
394}
395
396static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id)
397{
398 const struct mrfld_gpio_pinrange *range;
399 const char *pinctrl_dev_name;
400 struct mrfld_gpio *priv;
401 u32 gpio_base, irq_base;

--- 44 unchanged lines hidden (view full) ---

446
447 pci_set_drvdata(pdev, priv);
448 retval = devm_gpiochip_add_data(&pdev->dev, &priv->chip, priv);
449 if (retval) {
450 dev_err(&pdev->dev, "gpiochip_add error %d\n", retval);
451 return retval;
452 }
453
444 pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name();
454 pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(priv);
445 for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) {
446 range = &mrfld_gpio_ranges[i];
447 retval = gpiochip_add_pin_range(&priv->chip,
448 pinctrl_dev_name,
449 range->gpio_base,
450 range->pin_base,
451 range->npins);
452 if (retval) {

--- 37 unchanged lines hidden ---
455 for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) {
456 range = &mrfld_gpio_ranges[i];
457 retval = gpiochip_add_pin_range(&priv->chip,
458 pinctrl_dev_name,
459 range->gpio_base,
460 range->pin_base,
461 range->npins);
462 if (retval) {

--- 37 unchanged lines hidden ---