Lines Matching defs:hog

605 	/* There can only be one hog per line. */
606 struct gpio_sim_hog *hog;
637 static struct gpio_sim_device *gpio_sim_hog_get_device(struct gpio_sim_hog *hog)
639 struct gpio_sim_line *line = hog->parent;
719 struct gpiod_hog *hog;
726 for (hog = dev->hogs; hog->chip_label; hog++) {
727 kfree(hog->chip_label);
728 kfree(hog->line_name);
740 struct gpiod_hog *hog;
747 if (line->hog)
765 if (!line->hog)
768 hog = &dev->hogs[idx++];
776 hog->chip_label = kstrdup(bank->label,
779 hog->chip_label = kasprintf(GFP_KERNEL,
783 if (!hog->chip_label) {
789 * We need to duplicate this because the hog config
791 * it) and gpiolib doesn't make a deep copy of the hog
794 if (line->hog->name) {
795 hog->line_name = kstrdup(line->hog->name,
797 if (!hog->line_name) {
803 hog->chip_hwnum = line->offset;
804 hog->dflags = line->hog->dir;
1149 struct gpio_sim_hog *hog = to_gpio_sim_hog(item);
1150 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog);
1154 return sprintf(page, "%s\n", hog->name ?: "");
1160 struct gpio_sim_hog *hog = to_gpio_sim_hog(item);
1161 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog);
1173 kfree(hog->name);
1174 hog->name = trimmed;
1184 struct gpio_sim_hog *hog = to_gpio_sim_hog(item);
1185 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog);
1190 dir = hog->dir;
1204 WARN(1, "Unexpected hog direction value: %d", dir);
1215 struct gpio_sim_hog *hog = to_gpio_sim_hog(item);
1216 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog);
1233 hog->dir = dir;
1248 struct gpio_sim_hog *hog = to_gpio_sim_hog(item);
1249 struct gpio_sim_line *line = hog->parent;
1250 struct gpio_sim_device *dev = gpio_sim_hog_get_device(hog);
1253 line->hog = NULL;
1255 kfree(hog->name);
1256 kfree(hog);
1274 struct gpio_sim_hog *hog;
1276 if (strcmp(name, "hog") != 0)
1281 hog = kzalloc(sizeof(*hog), GFP_KERNEL);
1282 if (!hog)
1285 config_item_init_type_name(&hog->item, name,
1288 hog->dir = GPIOD_IN;
1289 hog->name = NULL;
1290 hog->parent = line;
1291 line->hog = hog;
1293 return &hog->item;