Lines Matching refs:hog

634 	struct gpio_sim_hog *hog;  member
665 static struct gpio_sim_device *gpio_sim_hog_get_device(struct gpio_sim_hog *hog) in gpio_sim_hog_get_device() argument
667 struct gpio_sim_line *line = hog->parent; in gpio_sim_hog_get_device()
779 struct gpiod_hog *hog; in gpio_sim_remove_hogs() local
786 for (hog = dev->hogs; hog->chip_label; hog++) { in gpio_sim_remove_hogs()
787 kfree(hog->chip_label); in gpio_sim_remove_hogs()
788 kfree(hog->line_name); in gpio_sim_remove_hogs()
800 struct gpiod_hog *hog; in gpio_sim_add_hogs() local
807 if (line->hog) in gpio_sim_add_hogs()
825 if (!line->hog) in gpio_sim_add_hogs()
828 hog = &dev->hogs[idx++]; in gpio_sim_add_hogs()
836 hog->chip_label = kstrdup(bank->label, in gpio_sim_add_hogs()
839 hog->chip_label = kasprintf(GFP_KERNEL, in gpio_sim_add_hogs()
843 if (!hog->chip_label) { in gpio_sim_add_hogs()
854 if (line->hog->name) { in gpio_sim_add_hogs()
855 hog->line_name = kstrdup(line->hog->name, in gpio_sim_add_hogs()
857 if (!hog->line_name) { in gpio_sim_add_hogs()
863 hog->chip_hwnum = line->offset; in gpio_sim_add_hogs()
864 hog->dflags = line->hog->dir; in gpio_sim_add_hogs()
1029 item = line->hog ? &line->hog->item in gpio_sim_device_lockup_configfs()
1277 struct gpio_sim_hog *hog = to_gpio_sim_hog(item); in gpio_sim_hog_config_name_show() local
1278 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog); in gpio_sim_hog_config_name_show()
1282 return sprintf(page, "%s\n", hog->name ?: ""); in gpio_sim_hog_config_name_show()
1288 struct gpio_sim_hog *hog = to_gpio_sim_hog(item); in gpio_sim_hog_config_name_store() local
1289 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog); in gpio_sim_hog_config_name_store()
1301 kfree(hog->name); in gpio_sim_hog_config_name_store()
1302 hog->name = trimmed; in gpio_sim_hog_config_name_store()
1312 struct gpio_sim_hog *hog = to_gpio_sim_hog(item); in gpio_sim_hog_config_direction_show() local
1313 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog); in gpio_sim_hog_config_direction_show()
1318 dir = hog->dir; in gpio_sim_hog_config_direction_show()
1343 struct gpio_sim_hog *hog = to_gpio_sim_hog(item); in gpio_sim_hog_config_direction_store() local
1344 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog); in gpio_sim_hog_config_direction_store()
1361 hog->dir = dir; in gpio_sim_hog_config_direction_store()
1376 struct gpio_sim_hog *hog = to_gpio_sim_hog(item); in gpio_sim_hog_config_item_release() local
1377 struct gpio_sim_line *line = hog->parent; in gpio_sim_hog_config_item_release()
1378 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog); in gpio_sim_hog_config_item_release()
1381 line->hog = NULL; in gpio_sim_hog_config_item_release()
1383 kfree(hog->name); in gpio_sim_hog_config_item_release()
1384 kfree(hog); in gpio_sim_hog_config_item_release()
1402 struct gpio_sim_hog *hog; in gpio_sim_line_config_make_hog_item() local
1409 hog = kzalloc_obj(*hog); in gpio_sim_line_config_make_hog_item()
1410 if (!hog) in gpio_sim_line_config_make_hog_item()
1413 config_item_init_type_name(&hog->item, name, in gpio_sim_line_config_make_hog_item()
1416 hog->dir = GPIOD_IN; in gpio_sim_line_config_make_hog_item()
1417 hog->name = NULL; in gpio_sim_line_config_make_hog_item()
1418 hog->parent = line; in gpio_sim_line_config_make_hog_item()
1419 line->hog = hog; in gpio_sim_line_config_make_hog_item()
1421 return &hog->item; in gpio_sim_line_config_make_hog_item()