Lines Matching full:ddc
475 struct ddc *dal_gpio_create_ddc( in dal_gpio_create_ddc()
483 struct ddc *ddc; in dal_gpio_create_ddc() local
488 ddc = kzalloc(sizeof(struct ddc), GFP_KERNEL); in dal_gpio_create_ddc()
490 if (!ddc) { in dal_gpio_create_ddc()
495 ddc->pin_data = dal_gpio_create( in dal_gpio_create_ddc()
498 if (!ddc->pin_data) { in dal_gpio_create_ddc()
503 ddc->pin_clock = dal_gpio_create( in dal_gpio_create_ddc()
506 if (!ddc->pin_clock) { in dal_gpio_create_ddc()
511 ddc->hw_info = *info; in dal_gpio_create_ddc()
513 ddc->ctx = service->ctx; in dal_gpio_create_ddc()
515 return ddc; in dal_gpio_create_ddc()
518 dal_gpio_destroy(&ddc->pin_data); in dal_gpio_create_ddc()
521 kfree(ddc); in dal_gpio_create_ddc()
527 struct ddc **ddc) in dal_gpio_destroy_ddc() argument
529 if (!ddc || !*ddc) { in dal_gpio_destroy_ddc()
534 dal_ddc_close(*ddc); in dal_gpio_destroy_ddc()
535 dal_gpio_destroy(&(*ddc)->pin_data); in dal_gpio_destroy_ddc()
536 dal_gpio_destroy(&(*ddc)->pin_clock); in dal_gpio_destroy_ddc()
537 kfree(*ddc); in dal_gpio_destroy_ddc()
539 *ddc = NULL; in dal_gpio_destroy_ddc()
543 struct ddc *ddc, in dal_ddc_open() argument
553 result = dal_gpio_open_ex(ddc->pin_data, mode); in dal_ddc_open()
560 result = dal_gpio_open_ex(ddc->pin_clock, mode); in dal_ddc_open()
567 /* DDC clock and data pins should belong in dal_ddc_open()
568 * to the same DDC block id, in dal_ddc_open()
578 config_data.config.ddc.type = config_type; in dal_ddc_open()
580 hw_data = FROM_HW_GPIO_PIN(ddc->pin_data->pin); in dal_ddc_open()
581 hw_clock = FROM_HW_GPIO_PIN(ddc->pin_clock->pin); in dal_ddc_open()
583 config_data.config.ddc.data_en_bit_present = hw_data->store.en != 0; in dal_ddc_open()
584 config_data.config.ddc.clock_en_bit_present = hw_clock->store.en != 0; in dal_ddc_open()
586 result = dal_gpio_set_config(ddc->pin_data, &config_data); in dal_ddc_open()
593 dal_gpio_close(ddc->pin_clock); in dal_ddc_open()
596 dal_gpio_close(ddc->pin_data); in dal_ddc_open()
602 struct ddc *ddc, in dal_ddc_change_mode() argument
608 dal_gpio_get_mode(ddc->pin_data); in dal_ddc_change_mode()
610 result = dal_gpio_change_mode(ddc->pin_data, mode); in dal_ddc_change_mode()
620 result = dal_gpio_change_mode(ddc->pin_clock, mode); in dal_ddc_change_mode()
625 dal_gpio_change_mode(ddc->pin_clock, original_mode); in dal_ddc_change_mode()
628 dal_gpio_change_mode(ddc->pin_data, original_mode); in dal_ddc_change_mode()
634 const struct ddc *ddc) in dal_ddc_get_line() argument
636 return (enum gpio_ddc_line)dal_gpio_get_enum(ddc->pin_data); in dal_ddc_get_line()
640 struct ddc *ddc, in dal_ddc_set_config() argument
647 config_data.config.ddc.type = config_type; in dal_ddc_set_config()
648 config_data.config.ddc.data_en_bit_present = false; in dal_ddc_set_config()
649 config_data.config.ddc.clock_en_bit_present = false; in dal_ddc_set_config()
651 return dal_gpio_set_config(ddc->pin_data, &config_data); in dal_ddc_set_config()
655 struct ddc *ddc) in dal_ddc_close() argument
657 if (ddc != NULL) { in dal_ddc_close()
658 dal_gpio_close(ddc->pin_clock); in dal_ddc_close()
659 dal_gpio_close(ddc->pin_data); in dal_ddc_close()