Skip to content

Commit 63ae99f

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: designware: Fix spelling and other issues in the comments
Fix spelling and other issues, such as kernel-doc reported about, in the comments. While at it, fix some indentation issues as well. Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 7a48e71 commit 63ae99f

File tree

6 files changed

+29
-22
lines changed

6 files changed

+29
-22
lines changed

drivers/i2c/busses/i2c-designware-amdpsp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static void psp_release_i2c_bus_deferred(struct work_struct *work)
155155

156156
/*
157157
* If there is any pending transaction, cannot release the bus here.
158-
* psp_release_i2c_bus will take care of this later.
158+
* psp_release_i2c_bus() will take care of this later.
159159
*/
160160
if (psp_i2c_access_count)
161161
goto cleanup;
@@ -210,12 +210,12 @@ static void psp_release_i2c_bus(void)
210210
{
211211
mutex_lock(&psp_i2c_access_mutex);
212212

213-
/* Return early if mailbox was malfunctional */
213+
/* Return early if mailbox was malfunctioned */
214214
if (psp_i2c_mbox_fail)
215215
goto cleanup;
216216

217217
/*
218-
* If we are last owner of PSP semaphore, need to release aribtration
218+
* If we are last owner of PSP semaphore, need to release arbitration
219219
* via mailbox.
220220
*/
221221
psp_i2c_access_count--;
@@ -235,9 +235,9 @@ static void psp_release_i2c_bus(void)
235235

236236
/*
237237
* Locking methods are based on the default implementation from
238-
* drivers/i2c/i2c-core-base.c, but with psp acquire and release operations
238+
* drivers/i2c/i2c-core-base.c, but with PSP acquire and release operations
239239
* added. With this in place we can ensure that i2c clients on the bus shared
240-
* with psp are able to lock HW access to the bus for arbitrary number of
240+
* with PSP are able to lock HW access to the bus for arbitrary number of
241241
* operations - that is e.g. write-wait-read.
242242
*/
243243
static void i2c_adapter_dw_psp_lock_bus(struct i2c_adapter *adapter,

drivers/i2c/busses/i2c-designware-common.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ static int dw_reg_write_word(void *context, unsigned int reg, unsigned int val)
127127
* Autodetects needed register access mode and creates the regmap with
128128
* corresponding read/write callbacks. This must be called before doing any
129129
* other register access.
130+
*
131+
* Return: 0 on success, or negative errno otherwise.
130132
*/
131133
int i2c_dw_init_regmap(struct dw_i2c_dev *dev)
132134
{
@@ -174,7 +176,7 @@ int i2c_dw_init_regmap(struct dw_i2c_dev *dev)
174176
/*
175177
* Note we'll check the return value of the regmap IO accessors only
176178
* at the probe stage. The rest of the code won't do this because
177-
* basically we have MMIO-based regmap so non of the read/write methods
179+
* basically we have MMIO-based regmap, so none of the read/write methods
178180
* can fail.
179181
*/
180182
dev->map = devm_regmap_init(dev->dev, NULL, dev, &map_cfg);
@@ -336,7 +338,7 @@ static u32 i2c_dw_acpi_round_bus_speed(struct device *device)
336338

337339
acpi_speed = i2c_acpi_find_bus_speed(device);
338340
/*
339-
* Some DSTDs use a non standard speed, round down to the lowest
341+
* Some DSDTs use a non standard speed, round down to the lowest
340342
* standard speed.
341343
*/
342344
for (i = 0; i < ARRAY_SIZE(supported_speeds); i++) {
@@ -549,7 +551,7 @@ void __i2c_dw_disable(struct dw_i2c_dev *dev)
549551

550552
/*
551553
* Wait 10 times the signaling period of the highest I2C
552-
* transfer supported by the driver (for 400KHz this is
554+
* transfer supported by the driver (for 400kHz this is
553555
* 25us) as described in the DesignWare I2C databook.
554556
*/
555557
usleep_range(25, 250);

drivers/i2c/busses/i2c-designware-core.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@
143143
#define DW_IC_SLAVE 1
144144

145145
/*
146-
* Hardware abort codes from the DW_IC_TX_ABRT_SOURCE register
146+
* Hardware abort codes from the DW_IC_TX_ABRT_SOURCE register.
147147
*
148-
* Only expected abort codes are listed here
149-
* refer to the datasheet for the full list
148+
* Only expected abort codes are listed here,
149+
* refer to the datasheet for the full list.
150150
*/
151151
#define ABRT_7B_ADDR_NOACK 0
152152
#define ABRT_10ADDR1_NOACK 1
@@ -201,7 +201,7 @@ struct reset_control;
201201
* @rst: optional reset for the controller
202202
* @slave: represent an I2C slave device
203203
* @get_clk_rate_khz: callback to retrieve IP specific bus speed
204-
* @cmd_err: run time hadware error code
204+
* @cmd_err: run time hardware error code
205205
* @msgs: points to an array of messages currently being transferred
206206
* @msgs_num: the number of elements in msgs
207207
* @msg_write_idx: the element index of the current tx message in the msgs array
@@ -237,7 +237,7 @@ struct reset_control;
237237
* @release_lock: function to release a hardware lock on the bus
238238
* @semaphore_idx: Index of table with semaphore type attached to the bus. It's
239239
* -1 if there is no semaphore.
240-
* @shared_with_punit: true if this bus is shared with the SoCs PUNIT
240+
* @shared_with_punit: true if this bus is shared with the SoC's PUNIT
241241
* @init: function to initialize the I2C hardware
242242
* @set_sda_hold_time: callback to retrieve IP specific SDA hold timing
243243
* @mode: operation mode - DW_IC_MASTER or DW_IC_SLAVE

drivers/i2c/busses/i2c-designware-master.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,14 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev)
180180
}
181181

182182
/**
183-
* i2c_dw_init_master() - Initialize the designware I2C master hardware
183+
* i2c_dw_init_master() - Initialize the DesignWare I2C master hardware
184184
* @dev: device private data
185185
*
186186
* This functions configures and enables the I2C master.
187187
* This function is called during I2C init function, and in case of timeout at
188188
* run time.
189+
*
190+
* Return: 0 on success, or negative errno otherwise.
189191
*/
190192
static int i2c_dw_init_master(struct dw_i2c_dev *dev)
191193
{
@@ -353,7 +355,7 @@ static int amd_i2c_dw_xfer_quirk(struct i2c_adapter *adap, struct i2c_msg *msgs,
353355
/*
354356
* Initiate the i2c read/write transaction of buffer length,
355357
* and poll for bus busy status. For the last message transfer,
356-
* update the command with stopbit enable.
358+
* update the command with stop bit enable.
357359
*/
358360
for (msg_itr_lmt = buf_len; msg_itr_lmt > 0; msg_itr_lmt--) {
359361
if (msg_wrt_idx == num_msgs - 1 && msg_itr_lmt == 1)
@@ -398,7 +400,7 @@ static int amd_i2c_dw_xfer_quirk(struct i2c_adapter *adap, struct i2c_msg *msgs,
398400

399401
/*
400402
* Initiate (and continue) low level master read/write transaction.
401-
* This function is only called from i2c_dw_isr, and pumping i2c_msg
403+
* This function is only called from i2c_dw_isr(), and pumping i2c_msg
402404
* messages into the tx buffer. Even if the size of i2c_msg data is
403405
* longer than the size of the tx buffer, it handles everything.
404406
*/
@@ -436,7 +438,8 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
436438
buf = msgs[dev->msg_write_idx].buf;
437439
buf_len = msgs[dev->msg_write_idx].len;
438440

439-
/* If both IC_EMPTYFIFO_HOLD_MASTER_EN and
441+
/*
442+
* If both IC_EMPTYFIFO_HOLD_MASTER_EN and
440443
* IC_RESTART_EN are set, we must manually
441444
* set restart bit between messages.
442445
*/
@@ -967,7 +970,7 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
967970
rinfo->unprepare_recovery = i2c_dw_unprepare_recovery;
968971
adap->bus_recovery_info = rinfo;
969972

970-
dev_info(dev->dev, "running with gpio recovery mode! scl%s",
973+
dev_info(dev->dev, "running with GPIO recovery mode! scl%s",
971974
rinfo->sda_gpiod ? ",sda" : "");
972975

973976
return 0;

drivers/i2c/busses/i2c-designware-platdrv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int bt1_i2c_write(void *context, unsigned int reg, unsigned int val)
7272
return ret;
7373

7474
return regmap_write(dev->sysmap, BT1_I2C_CTL,
75-
BT1_I2C_CTL_GO | BT1_I2C_CTL_WR | (reg & BT1_I2C_CTL_ADDR_MASK));
75+
BT1_I2C_CTL_GO | BT1_I2C_CTL_WR | (reg & BT1_I2C_CTL_ADDR_MASK));
7676
}
7777

7878
static const struct regmap_config bt1_i2c_cfg = {
@@ -278,7 +278,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
278278
adap = &dev->adapter;
279279
adap->owner = THIS_MODULE;
280280
adap->class = dmi_check_system(dw_i2c_hwmon_class_dmi) ?
281-
I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED;
281+
I2C_CLASS_HWMON : I2C_CLASS_DEPRECATED;
282282
adap->nr = -1;
283283

284284
if (dev->flags & ACCESS_NO_IRQ_SUSPEND)

drivers/i2c/busses/i2c-designware-slave.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ static void i2c_dw_configure_fifo_slave(struct dw_i2c_dev *dev)
3232
}
3333

3434
/**
35-
* i2c_dw_init_slave() - Initialize the designware i2c slave hardware
35+
* i2c_dw_init_slave() - Initialize the DesignWare i2c slave hardware
3636
* @dev: device private data
3737
*
3838
* This function configures and enables the I2C in slave mode.
3939
* This function is called during I2C init function, and in case of timeout at
4040
* run time.
41+
*
42+
* Return: 0 on success, or negative errno otherwise.
4143
*/
4244
static int i2c_dw_init_slave(struct dw_i2c_dev *dev)
4345
{
@@ -264,7 +266,7 @@ int i2c_dw_probe_slave(struct dw_i2c_dev *dev)
264266
ret = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr_slave,
265267
IRQF_SHARED, dev_name(dev->dev), dev);
266268
if (ret) {
267-
dev_err(dev->dev, "failure requesting irq %i: %d\n",
269+
dev_err(dev->dev, "failure requesting IRQ %i: %d\n",
268270
dev->irq, ret);
269271
return ret;
270272
}

0 commit comments

Comments
 (0)