gpio-mmio.c (e698613ada5896a42d2f352296fd999d7dcaf4f3) | gpio-mmio.c (c0d30ecfe2f3e2254234d055982536fac18c7f1c) |
---|---|
1/* 2 * Generic driver for memory-mapped GPIO controllers. 3 * 4 * Copyright 2008 MontaVista Software, Inc. 5 * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com> 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the --- 559 unchanged lines hidden (view full) --- 568 if (sz != sane_sz) 569 return IOMEM_ERR_PTR(-EINVAL); 570 571 return devm_ioremap_resource(&pdev->dev, r); 572} 573 574#ifdef CONFIG_OF 575static const struct of_device_id bgpio_of_match[] = { | 1/* 2 * Generic driver for memory-mapped GPIO controllers. 3 * 4 * Copyright 2008 MontaVista Software, Inc. 5 * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com> 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the --- 559 unchanged lines hidden (view full) --- 568 if (sz != sane_sz) 569 return IOMEM_ERR_PTR(-EINVAL); 570 571 return devm_ioremap_resource(&pdev->dev, r); 572} 573 574#ifdef CONFIG_OF 575static const struct of_device_id bgpio_of_match[] = { |
576 { .compatible = "wd,mbl-gpio" }, |
|
576 { } 577}; 578MODULE_DEVICE_TABLE(of, bgpio_of_match); 579 580static struct bgpio_pdata *bgpio_parse_dt(struct platform_device *pdev, 581 unsigned long *flags) 582{ 583 struct bgpio_pdata *pdata; 584 585 if (!of_match_device(bgpio_of_match, &pdev->dev)) 586 return NULL; 587 588 pdata = devm_kzalloc(&pdev->dev, sizeof(struct bgpio_pdata), 589 GFP_KERNEL); 590 if (!pdata) 591 return ERR_PTR(-ENOMEM); 592 593 pdata->base = -1; 594 | 577 { } 578}; 579MODULE_DEVICE_TABLE(of, bgpio_of_match); 580 581static struct bgpio_pdata *bgpio_parse_dt(struct platform_device *pdev, 582 unsigned long *flags) 583{ 584 struct bgpio_pdata *pdata; 585 586 if (!of_match_device(bgpio_of_match, &pdev->dev)) 587 return NULL; 588 589 pdata = devm_kzalloc(&pdev->dev, sizeof(struct bgpio_pdata), 590 GFP_KERNEL); 591 if (!pdata) 592 return ERR_PTR(-ENOMEM); 593 594 pdata->base = -1; 595 |
596 if (of_property_read_bool(pdev->dev.of_node, "no-output")) 597 *flags |= BGPIOF_NO_OUTPUT; 598 |
|
595 return pdata; 596} 597#else 598static struct bgpio_pdata *bgpio_parse_dt(struct platform_device *pdev, 599 unsigned long *flags) 600{ 601 return NULL; 602} --- 101 unchanged lines hidden --- | 599 return pdata; 600} 601#else 602static struct bgpio_pdata *bgpio_parse_dt(struct platform_device *pdev, 603 unsigned long *flags) 604{ 605 return NULL; 606} --- 101 unchanged lines hidden --- |