Lines Matching refs:stmf
487 struct stm_file *stmf; in stm_char_open() local
496 stmf = kzalloc(sizeof(*stmf), GFP_KERNEL); in stm_char_open()
497 if (!stmf) in stm_char_open()
501 stm_output_init(&stmf->output); in stm_char_open()
502 stmf->stm = to_stm_device(dev); in stm_char_open()
504 if (!try_module_get(stmf->stm->owner)) in stm_char_open()
507 file->private_data = stmf; in stm_char_open()
512 kfree(stmf); in stm_char_open()
522 struct stm_file *stmf = file->private_data; in stm_char_release() local
523 struct stm_device *stm = stmf->stm; in stm_char_release()
526 stm->data->unlink(stm->data, stmf->output.master, in stm_char_release()
527 stmf->output.channel); in stm_char_release()
529 stm_output_free(stm, &stmf->output); in stm_char_release()
536 kfree(stmf); in stm_char_release()
621 struct stm_file *stmf = file->private_data; in stm_char_write() local
622 struct stm_device *stm = stmf->stm; in stm_char_write()
633 if (!stmf->output.nr_chans) { in stm_char_write()
639 err = stm_assign_first_policy(stmf->stm, &stmf->output, ids, 1); in stm_char_write()
660 count = stm_write(stm, &stmf->output, 0, kbuf, count); in stm_char_write()
671 struct stm_file *stmf = vma->vm_file->private_data; in stm_mmap_open() local
672 struct stm_device *stm = stmf->stm; in stm_mmap_open()
679 struct stm_file *stmf = vma->vm_file->private_data; in stm_mmap_close() local
680 struct stm_device *stm = stmf->stm; in stm_mmap_close()
693 struct stm_file *stmf = file->private_data; in stm_char_mmap() local
694 struct stm_device *stm = stmf->stm; in stm_char_mmap()
705 if (stmf->output.nr_chans * stm->data->sw_mmiosz != size) in stm_char_mmap()
708 phys = stm->data->mmio_addr(stm->data, stmf->output.master, in stm_char_mmap()
709 stmf->output.channel, in stm_char_mmap()
710 stmf->output.nr_chans); in stm_char_mmap()
725 static int stm_char_policy_set_ioctl(struct stm_file *stmf, void __user *arg) in stm_char_policy_set_ioctl() argument
727 struct stm_device *stm = stmf->stm; in stm_char_policy_set_ioctl()
733 if (stmf->output.nr_chans) in stm_char_policy_set_ioctl()
765 ret = stm_assign_first_policy(stmf->stm, &stmf->output, ids, in stm_char_policy_set_ioctl()
771 ret = stm->data->link(stm->data, stmf->output.master, in stm_char_policy_set_ioctl()
772 stmf->output.channel); in stm_char_policy_set_ioctl()
775 stm_output_free(stmf->stm, &stmf->output); in stm_char_policy_set_ioctl()
783 static int stm_char_policy_get_ioctl(struct stm_file *stmf, void __user *arg) in stm_char_policy_get_ioctl() argument
787 .master = stmf->output.master, in stm_char_policy_get_ioctl()
788 .channel = stmf->output.channel, in stm_char_policy_get_ioctl()
789 .width = stmf->output.nr_chans, in stm_char_policy_get_ioctl()
800 struct stm_file *stmf = file->private_data; in stm_char_ioctl() local
801 struct stm_data *stm_data = stmf->stm->data; in stm_char_ioctl()
807 err = stm_char_policy_set_ioctl(stmf, (void __user *)arg); in stm_char_ioctl()
811 return stm_char_policy_get_ioctl(stmf, (void __user *)arg); in stm_char_ioctl()
814 return stm_char_policy_get_ioctl(stmf, (void __user *)arg); in stm_char_ioctl()
822 stmf->output.master, in stm_char_ioctl()
823 stmf->output.channel, in stm_char_ioctl()
824 stmf->output.nr_chans, in stm_char_ioctl()