1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * SH Pin Function Control Initialization 4 * 5 * Copyright (C) 2012 Renesas Solutions Corp. 6 */ 7 8 #include <linux/err.h> 9 #include <linux/init.h> 10 #include <linux/platform_device.h> 11 #include <linux/property.h> 12 13 #include <cpu/pfc.h> 14 15 const struct software_node pfc_gpiochip_node = { 16 .name = "sh-pfc", 17 }; 18 19 int __init sh_pfc_register(const char *name, 20 struct resource *resource, u32 num_resources) 21 { 22 struct platform_device_info pdev_info = { 23 .name = name, 24 .id = PLATFORM_DEVID_NONE, 25 .res = resource, 26 .num_res = num_resources, 27 .swnode = &pfc_gpiochip_node, 28 }; 29 struct platform_device *pdev; 30 31 pdev = platform_device_register_full(&pdev_info); 32 return PTR_ERR_OR_ZERO(pdev); 33 } 34