Lines Matching refs:feat

753 fwcam_get_feature(struct fwcam_softc *sc, struct fwcam_feature *feat)  in fwcam_get_feature()  argument
758 if (feat->id >= FWCAM_FEAT_MAX) in fwcam_get_feature()
761 feat->flags = 0; in fwcam_get_feature()
762 feat->min = 0; in fwcam_get_feature()
763 feat->max = 0; in fwcam_get_feature()
764 if (feat->id < nitems(fwcam_feat_inq) && in fwcam_get_feature()
765 fwcam_feat_inq[feat->id] != 0) { in fwcam_get_feature()
766 err = fwcam_read_quadlet(sc, fwcam_feat_inq[feat->id], &inq); in fwcam_get_feature()
771 feat->flags |= FWCAM_FEATF_PRESENT; in fwcam_get_feature()
773 feat->flags |= FWCAM_FEATF_ONOFF; in fwcam_get_feature()
775 feat->flags |= FWCAM_FEATF_AUTO; in fwcam_get_feature()
777 feat->flags |= FWCAM_FEATF_MANUAL; in fwcam_get_feature()
778 feat->min = (inq >> 12) & 0xfff; in fwcam_get_feature()
779 feat->max = inq & 0xfff; in fwcam_get_feature()
782 if (feat->id >= nitems(fwcam_feat_ctrl) || in fwcam_get_feature()
783 fwcam_feat_ctrl[feat->id] == 0) in fwcam_get_feature()
786 err = fwcam_read_quadlet(sc, fwcam_feat_ctrl[feat->id], &ctrl); in fwcam_get_feature()
790 feat->value = ctrl & 0xfff; in fwcam_get_feature()
792 if (feat->id == FWCAM_FEAT_WHITE_BALANCE) in fwcam_get_feature()
793 feat->value2 = (ctrl >> 12) & 0xfff; in fwcam_get_feature()
795 feat->value2 = 0; in fwcam_get_feature()
801 fwcam_set_feature(struct fwcam_softc *sc, struct fwcam_feature *feat) in fwcam_set_feature() argument
806 if (feat->id >= FWCAM_FEAT_MAX) in fwcam_set_feature()
808 if (feat->id >= nitems(fwcam_feat_ctrl) || in fwcam_set_feature()
809 fwcam_feat_ctrl[feat->id] == 0) in fwcam_set_feature()
812 err = fwcam_read_quadlet(sc, fwcam_feat_ctrl[feat->id], &ctrl); in fwcam_set_feature()
816 if (feat->id == FWCAM_FEAT_WHITE_BALANCE) { in fwcam_set_feature()
819 ((feat->value2 & 0xfff) << 12) | in fwcam_set_feature()
820 (feat->value & 0xfff); in fwcam_set_feature()
823 val = (ctrl & 0xfffff000) | (feat->value & 0xfff); in fwcam_set_feature()
826 return (fwcam_write_quadlet(sc, fwcam_feat_ctrl[feat->id], val)); in fwcam_set_feature()
1127 struct fwcam_feature feat; in fwcam_hw_query_control() local
1134 feat.id = fid; in fwcam_hw_query_control()
1135 if (fwcam_get_feature(sc, &feat) != 0) in fwcam_hw_query_control()
1138 if (!(feat.flags & FWCAM_FEATF_PRESENT)) in fwcam_hw_query_control()
1143 qc->minimum = feat.min; in fwcam_hw_query_control()
1144 qc->maximum = feat.max; in fwcam_hw_query_control()
1146 qc->default_value = feat.min; in fwcam_hw_query_control()
1156 struct fwcam_feature feat; in fwcam_hw_get_control() local
1163 feat.id = fid; in fwcam_hw_get_control()
1164 if (fwcam_get_feature(sc, &feat) != 0) in fwcam_hw_get_control()
1167 ctrl->value = feat.value; in fwcam_hw_get_control()
1175 struct fwcam_feature feat; in fwcam_hw_set_control() local
1182 feat.id = fid; in fwcam_hw_set_control()
1183 feat.value = ctrl->value; in fwcam_hw_set_control()
1184 feat.value2 = 0; in fwcam_hw_set_control()
1185 return (fwcam_set_feature(sc, &feat)); in fwcam_hw_set_control()