Lines Matching refs:sma_nr
382 static int ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr);
908 u32 (*get)(struct ptp_ocp *bp, int sma_nr);
909 int (*set_inputs)(struct ptp_ocp *bp, int sma_nr, u32 val);
910 int (*set_output)(struct ptp_ocp *bp, int sma_nr, u32 val);
920 ptp_ocp_sma_get(struct ptp_ocp *bp, int sma_nr) in ptp_ocp_sma_get() argument
922 return bp->sma_op->get(bp, sma_nr); in ptp_ocp_sma_get()
926 ptp_ocp_sma_set_inputs(struct ptp_ocp *bp, int sma_nr, u32 val) in ptp_ocp_sma_set_inputs() argument
928 return bp->sma_op->set_inputs(bp, sma_nr, val); in ptp_ocp_sma_set_inputs()
932 ptp_ocp_sma_set_output(struct ptp_ocp *bp, int sma_nr, u32 val) in ptp_ocp_sma_set_output() argument
934 return bp->sma_op->set_output(bp, sma_nr, val); in ptp_ocp_sma_set_output()
2220 ptp_ocp_sma_fb_get(struct ptp_ocp *bp, int sma_nr) in ptp_ocp_sma_fb_get() argument
2225 if (bp->sma[sma_nr - 1].fixed_fcn) in ptp_ocp_sma_fb_get()
2226 return (sma_nr - 1) & 1; in ptp_ocp_sma_fb_get()
2228 if (bp->sma[sma_nr - 1].mode == SMA_MODE_IN) in ptp_ocp_sma_fb_get()
2229 gpio = sma_nr > 2 ? &bp->sma_map2->gpio1 : &bp->sma_map1->gpio1; in ptp_ocp_sma_fb_get()
2231 gpio = sma_nr > 2 ? &bp->sma_map1->gpio2 : &bp->sma_map2->gpio2; in ptp_ocp_sma_fb_get()
2232 shift = sma_nr & 1 ? 0 : 16; in ptp_ocp_sma_fb_get()
2238 ptp_ocp_sma_fb_set_output(struct ptp_ocp *bp, int sma_nr, u32 val) in ptp_ocp_sma_fb_set_output() argument
2244 gpio = sma_nr > 2 ? &bp->sma_map1->gpio2 : &bp->sma_map2->gpio2; in ptp_ocp_sma_fb_set_output()
2245 shift = sma_nr & 1 ? 0 : 16; in ptp_ocp_sma_fb_set_output()
2264 ptp_ocp_sma_fb_set_inputs(struct ptp_ocp *bp, int sma_nr, u32 val) in ptp_ocp_sma_fb_set_inputs() argument
2270 gpio = sma_nr > 2 ? &bp->sma_map2->gpio1 : &bp->sma_map1->gpio1; in ptp_ocp_sma_fb_set_inputs()
2271 shift = sma_nr & 1 ? 0 : 16; in ptp_ocp_sma_fb_set_inputs()
2498 ptp_ocp_art_sma_get(struct ptp_ocp *bp, int sma_nr) in ptp_ocp_art_sma_get() argument
2500 if (bp->sma[sma_nr - 1].fixed_fcn) in ptp_ocp_art_sma_get()
2501 return bp->sma[sma_nr - 1].default_fcn; in ptp_ocp_art_sma_get()
2503 return ioread32(&bp->art_sma->map[sma_nr - 1].gpio) & 0xff; in ptp_ocp_art_sma_get()
2508 ptp_ocp_art_sma_set(struct ptp_ocp *bp, int sma_nr, u32 val) in ptp_ocp_art_sma_set() argument
2519 gpio = &bp->art_sma->map[sma_nr - 1].gpio; in ptp_ocp_art_sma_set()
2647 ptp_ocp_sma_show(struct ptp_ocp *bp, int sma_nr, char *buf, in ptp_ocp_sma_show() argument
2650 struct ptp_ocp_sma_connector *sma = &bp->sma[sma_nr - 1]; in ptp_ocp_sma_show()
2655 val = ptp_ocp_sma_get(bp, sma_nr) & SMA_SELECT_MASK; in ptp_ocp_sma_show()
2699 ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr) in ptp_ocp_sma_store() argument
2701 struct ptp_ocp_sma_connector *sma = &bp->sma[sma_nr - 1]; in ptp_ocp_sma_store()
2723 ptp_ocp_sma_set_output(bp, sma_nr, 0); in ptp_ocp_sma_store()
2725 ptp_ocp_sma_set_inputs(bp, sma_nr, 0); in ptp_ocp_sma_store()
2736 val = ptp_ocp_sma_set_inputs(bp, sma_nr, val); in ptp_ocp_sma_store()
2738 val = ptp_ocp_sma_set_output(bp, sma_nr, val); in ptp_ocp_sma_store()