80
80
#define DEFAULT_SCL_RATE (100 * 1000) /* Hz */
81
81
82
82
/**
83
- * struct i2c_spec_values:
83
+ * struct i2c_spec_values - I2C specification values for various modes
84
84
* @min_hold_start_ns: min hold time (repeated) START condition
85
85
* @min_low_ns: min LOW period of the SCL clock
86
86
* @min_high_ns: min HIGH period of the SCL cloc
@@ -136,7 +136,7 @@ static const struct i2c_spec_values fast_mode_plus_spec = {
136
136
};
137
137
138
138
/**
139
- * struct rk3x_i2c_calced_timings:
139
+ * struct rk3x_i2c_calced_timings - calculated V1 timings
140
140
* @div_low: Divider output for low
141
141
* @div_high: Divider output for high
142
142
* @tuning: Used to adjust setup/hold data time,
@@ -159,7 +159,7 @@ enum rk3x_i2c_state {
159
159
};
160
160
161
161
/**
162
- * struct rk3x_i2c_soc_data:
162
+ * struct rk3x_i2c_soc_data - SOC-specific data
163
163
* @grf_offset: offset inside the grf regmap for setting the i2c type
164
164
* @calc_timings: Callback function for i2c timing information calculated
165
165
*/
@@ -239,7 +239,8 @@ static inline void rk3x_i2c_clean_ipd(struct rk3x_i2c *i2c)
239
239
}
240
240
241
241
/**
242
- * Generate a START condition, which triggers a REG_INT_START interrupt.
242
+ * rk3x_i2c_start - Generate a START condition, which triggers a REG_INT_START interrupt.
243
+ * @i2c: target controller data
243
244
*/
244
245
static void rk3x_i2c_start (struct rk3x_i2c * i2c )
245
246
{
@@ -258,8 +259,8 @@ static void rk3x_i2c_start(struct rk3x_i2c *i2c)
258
259
}
259
260
260
261
/**
261
- * Generate a STOP condition, which triggers a REG_INT_STOP interrupt.
262
- *
262
+ * rk3x_i2c_stop - Generate a STOP condition, which triggers a REG_INT_STOP interrupt.
263
+ * @i2c: target controller data
263
264
* @error: Error code to return in rk3x_i2c_xfer
264
265
*/
265
266
static void rk3x_i2c_stop (struct rk3x_i2c * i2c , int error )
@@ -298,7 +299,8 @@ static void rk3x_i2c_stop(struct rk3x_i2c *i2c, int error)
298
299
}
299
300
300
301
/**
301
- * Setup a read according to i2c->msg
302
+ * rk3x_i2c_prepare_read - Setup a read according to i2c->msg
303
+ * @i2c: target controller data
302
304
*/
303
305
static void rk3x_i2c_prepare_read (struct rk3x_i2c * i2c )
304
306
{
@@ -329,7 +331,8 @@ static void rk3x_i2c_prepare_read(struct rk3x_i2c *i2c)
329
331
}
330
332
331
333
/**
332
- * Fill the transmit buffer with data from i2c->msg
334
+ * rk3x_i2c_fill_transmit_buf - Fill the transmit buffer with data from i2c->msg
335
+ * @i2c: target controller data
333
336
*/
334
337
static void rk3x_i2c_fill_transmit_buf (struct rk3x_i2c * i2c )
335
338
{
@@ -532,11 +535,10 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id)
532
535
}
533
536
534
537
/**
535
- * Get timing values of I2C specification
536
- *
538
+ * rk3x_i2c_get_spec - Get timing values of I2C specification
537
539
* @speed: Desired SCL frequency
538
540
*
539
- * Returns : Matched i2c spec values .
541
+ * Return : Matched i2c_spec_values .
540
542
*/
541
543
static const struct i2c_spec_values * rk3x_i2c_get_spec (unsigned int speed )
542
544
{
@@ -549,13 +551,12 @@ static const struct i2c_spec_values *rk3x_i2c_get_spec(unsigned int speed)
549
551
}
550
552
551
553
/**
552
- * Calculate divider values for desired SCL frequency
553
- *
554
+ * rk3x_i2c_v0_calc_timings - Calculate divider values for desired SCL frequency
554
555
* @clk_rate: I2C input clock rate
555
556
* @t: Known I2C timing information
556
557
* @t_calc: Caculated rk3x private timings that would be written into regs
557
558
*
558
- * Returns: 0 on success, -EINVAL if the goal SCL rate is too slow. In that case
559
+ * Return: % 0 on success, -% EINVAL if the goal SCL rate is too slow. In that case
559
560
* a best-effort divider value is returned in divs. If the target rate is
560
561
* too high, we silently use the highest possible rate.
561
562
*/
@@ -710,13 +711,12 @@ static int rk3x_i2c_v0_calc_timings(unsigned long clk_rate,
710
711
}
711
712
712
713
/**
713
- * Calculate timing values for desired SCL frequency
714
- *
714
+ * rk3x_i2c_v1_calc_timings - Calculate timing values for desired SCL frequency
715
715
* @clk_rate: I2C input clock rate
716
716
* @t: Known I2C timing information
717
717
* @t_calc: Caculated rk3x private timings that would be written into regs
718
718
*
719
- * Returns: 0 on success, -EINVAL if the goal SCL rate is too slow. In that case
719
+ * Return: % 0 on success, -% EINVAL if the goal SCL rate is too slow. In that case
720
720
* a best-effort divider value is returned in divs. If the target rate is
721
721
* too high, we silently use the highest possible rate.
722
722
* The following formulas are v1's method to calculate timings.
@@ -960,14 +960,14 @@ static int rk3x_i2c_clk_notifier_cb(struct notifier_block *nb, unsigned long
960
960
}
961
961
962
962
/**
963
- * Setup I2C registers for an I2C operation specified by msgs, num.
964
- *
965
- * Must be called with i2c->lock held.
966
- *
963
+ * rk3x_i2c_setup - Setup I2C registers for an I2C operation specified by msgs, num.
964
+ * @i2c: target controller data
967
965
* @msgs: I2C msgs to process
968
966
* @num: Number of msgs
969
967
*
970
- * returns: Number of I2C msgs processed or negative in case of error
968
+ * Must be called with i2c->lock held.
969
+ *
970
+ * Return: Number of I2C msgs processed or negative in case of error
971
971
*/
972
972
static int rk3x_i2c_setup (struct rk3x_i2c * i2c , struct i2c_msg * msgs , int num )
973
973
{
0 commit comments