Lines Matching defs:ncycles
29 * @ncycles: number of MCK clk cycles
35 * This function encodes the @ncycles value as described in the datasheet
40 * If the @ncycles value is too big to be encoded, -ERANGE is returned and
43 static int atmel_smc_cs_encode_ncycles(unsigned int ncycles,
54 msb = ncycles / msbfactor;
55 lsb = ncycles % msbfactor;
83 * @ncycles: value (expressed in MCK clk cycles) to assign to this Txx
86 * This function encodes the @ncycles value as described in the datasheet
90 * Returns -EINVAL if shift is invalid, -ERANGE if ncycles does not fit in
94 unsigned int shift, unsigned int ncycles)
110 * ncycles = (Txx[3] * 64) + Txx[2:0]
112 ret = atmel_smc_cs_encode_ncycles(ncycles, 3, 1, 64, &val);
125 * @ncycles: value (expressed in MCK clk cycles) to assign to this xx_SETUP
128 * This function encodes the @ncycles value as described in the datasheet
132 * Returns -EINVAL if @shift is invalid, -ERANGE if @ncycles does not fit in
136 unsigned int shift, unsigned int ncycles)
149 * ncycles = (128 * xx_SETUP[5]) + xx_SETUP[4:0]
151 ret = atmel_smc_cs_encode_ncycles(ncycles, 5, 1, 128, &val);
164 * @ncycles: value (expressed in MCK clk cycles) to assign to this xx_PULSE
167 * This function encodes the @ncycles value as described in the datasheet
171 * Returns -EINVAL if @shift is invalid, -ERANGE if @ncycles does not fit in
175 unsigned int shift, unsigned int ncycles)
188 * ncycles = (256 * xx_PULSE[6]) + xx_PULSE[5:0]
190 ret = atmel_smc_cs_encode_ncycles(ncycles, 6, 1, 256, &val);
203 * @ncycles: value (expressed in MCK clk cycles) to assign to this xx_CYCLE
206 * This function encodes the @ncycles value as described in the datasheet
210 * Returns -EINVAL if @shift is invalid, -ERANGE if @ncycles does not fit in
214 unsigned int shift, unsigned int ncycles)
226 * ncycles = (xx_CYCLE[8:7] * 256) + xx_CYCLE[6:0]
228 ret = atmel_smc_cs_encode_ncycles(ncycles, 7, 2, 256, &val);