Lines Matching refs:gpiod

43 	struct usb_cam_gpio *gpiod = container_of(sys_dev, struct usb_cam_gpio,  in hd_camera_on_show()  local
46 return sprintf(buf, "%d\n", gpiod_get_value(gpiod->gpio_cam_hd)); in hd_camera_on_show()
53 struct usb_cam_gpio *gpiod = container_of(sys_dev, struct usb_cam_gpio, in hd_camera_on_store() local
63 gpiod_set_value(gpiod->gpio_cam_hd, val); in hd_camera_on_store()
73 struct usb_cam_gpio *gpiod = container_of(sys_dev, in ir_camera_on_show() local
76 return sprintf(buf, "%d\n", gpiod_get_value(gpiod->gpio_cam_ir)); in ir_camera_on_show()
83 struct usb_cam_gpio *gpiod = container_of(sys_dev, in ir_camera_on_store() local
93 gpiod_set_value(gpiod->gpio_cam_ir, val); in ir_camera_on_store()
106 static int usb_cam_gpio_device_register(struct usb_cam_gpio *gpiod) in usb_cam_gpio_device_register() argument
109 struct device *dev = &gpiod->sys_dev; in usb_cam_gpio_device_register()
114 dev_set_drvdata(dev, gpiod); in usb_cam_gpio_device_register()
122 struct usb_cam_gpio *gpiod; in usb_cam_gpio_probe() local
133 gpiod = devm_kzalloc(&pdev->dev, sizeof(*gpiod), GFP_KERNEL); in usb_cam_gpio_probe()
134 if (!gpiod) in usb_cam_gpio_probe()
137 gpiod->dev = &pdev->dev; in usb_cam_gpio_probe()
139 gpiod->gpio_cam_hd = devm_gpiod_get_optional(gpiod->dev, in usb_cam_gpio_probe()
141 if (IS_ERR(gpiod->gpio_cam_hd)) { in usb_cam_gpio_probe()
142 dev_warn(gpiod->dev, "Could not get hd-cam-gpios!\n"); in usb_cam_gpio_probe()
143 gpiod->gpio_cam_hd = NULL; in usb_cam_gpio_probe()
146 gpiod->gpio_cam_ir = devm_gpiod_get_optional(gpiod->dev, in usb_cam_gpio_probe()
148 if (IS_ERR(gpiod->gpio_cam_ir)) { in usb_cam_gpio_probe()
149 dev_warn(gpiod->dev, "Could not get ir-cam-gpios!\n"); in usb_cam_gpio_probe()
150 gpiod->gpio_cam_ir = NULL; in usb_cam_gpio_probe()
153 ret = usb_cam_gpio_device_register(gpiod); in usb_cam_gpio_probe()
155 dev_err(gpiod->dev, "usb_cam_gpio device register fail\n"); in usb_cam_gpio_probe()
159 dev_info(gpiod->dev, "usb_cam_gpio_probe success\n"); in usb_cam_gpio_probe()