Skip to content

Commit

Permalink
Fixed code formatting according to Linux style
Browse files Browse the repository at this point in the history
... with minor deviations as set in scripts/clang-format.sh
  • Loading branch information
klogg committed May 9, 2024
1 parent 81a43f7 commit ad56934
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 35 deletions.
16 changes: 7 additions & 9 deletions bridge/it66121_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static void it66121_is_hpd_detect(struct it66121_priv *priv)
priv->conn_status = connector_status_unknown;
} else {
priv->conn_status = val ? connector_status_connected :
connector_status_disconnected;
connector_status_disconnected;
}
}

Expand Down Expand Up @@ -448,7 +448,7 @@ static int it66121_bind(struct device *comp, struct device *master, void *master
struct drm_simple_display_pipe *pipe = master_data;
struct i2c_adapter *adapter = i2c_verify_adapter(master);

if(!adapter)
if (!adapter)
return -ENODEV;

dev_info(comp, "Binding IT66121 component");
Expand Down Expand Up @@ -719,10 +719,8 @@ static const struct drm_bridge_funcs it66121_bridge_funcs = {
.mode_set = it66121_bridge_mode_set,
};


static int it66121_regs_init(struct it66121_priv *priv, struct i2c_client *client)
{

priv->regmap = devm_regmap_init_i2c(client, &it66121_regmap_config);
if (IS_ERR(priv->regmap))
return PTR_ERR(priv);
Expand Down Expand Up @@ -758,8 +756,8 @@ static int it66121_regs_init(struct it66121_priv *priv, struct i2c_client *clien
static int it66121_i2c_probe(struct i2c_adapter *adapter, unsigned short address)
{
int i, ret;
u8 id_regs[] = {IT66121_VENDOR_ID_1, IT66121_VENDOR_ID_2,
IT66121_DEVICE_ID_1, IT66121_DEVICE_ID_2};
u8 id_regs[] = { IT66121_VENDOR_ID_1, IT66121_VENDOR_ID_2, IT66121_DEVICE_ID_1,
IT66121_DEVICE_ID_2 };
union {
struct {
u16 vendor;
Expand All @@ -779,8 +777,8 @@ static int it66121_i2c_probe(struct i2c_adapter *adapter, unsigned short address

for (i = 0; i < ARRAY_SIZE(id_regs); i++) {
struct i2c_msg msgs[] = {
{ .addr = address, .flags = 0, .len = 1, .buf = &id_regs[i]},
{ .addr = address, .flags = I2C_M_RD, .len = 1, .buf = &id.b[i]}
{ .addr = address, .flags = 0, .len = 1, .buf = &id_regs[i] },
{ .addr = address, .flags = I2C_M_RD, .len = 1, .buf = &id.b[i] }
};

ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs));
Expand All @@ -796,7 +794,7 @@ static int it66121_i2c_probe(struct i2c_adapter *adapter, unsigned short address
}

dev_info(&adapter->dev, "IT66121 found, revision %d",
(id.device & REVISION_MASK) >> REVISION_SHIFT);
(id.device & REVISION_MASK) >> REVISION_SHIFT);

return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions fl2000_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static u64 fl2000_pll_calc(u64 clock_mil, struct fl2000_pll *pll, u32 *clock_cal
pll->function = vco_clk < 125000000 ? 0 :
vco_clk < 250000000 ? 1 :
vco_clk < 500000000 ? 2 :
3;
3;
*clock_calculated = vco_clk / divisor;
}

Expand Down Expand Up @@ -310,8 +310,8 @@ static void fb2000_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
if (ret)
return;

fl2000_stream_compress(drm_if->stream, dma_obj->vaddr, fb->height,
fb->width, fb->pitches[0]);
fl2000_stream_compress(drm_if->stream, dma_obj->vaddr, fb->height, fb->width,
fb->pitches[0]);

drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);

Expand Down
7 changes: 3 additions & 4 deletions fl2000_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
#define USB_VENDOR_FRESCO_LOGIC 0x1D5C
#define USB_PRODUCT_FL2000 0x2000

#define FL2000_ALL_IFS (BIT(FL2000_USBIF_AVCONTROL) | \
BIT(FL2000_USBIF_STREAMING) | \
BIT(FL2000_USBIF_INTERRUPT))
#define FL2000_ALL_IFS \
(BIT(FL2000_USBIF_AVCONTROL) | BIT(FL2000_USBIF_STREAMING) | BIT(FL2000_USBIF_INTERRUPT))

static struct usb_device_id fl2000_id_table[] = {
{ USB_DEVICE_INTERFACE_CLASS(USB_VENDOR_FRESCO_LOGIC, USB_PRODUCT_FL2000, USB_CLASS_AV) },
Expand Down Expand Up @@ -118,7 +117,7 @@ static int fl2000_probe(struct usb_interface *interface, const struct usb_device
/* When all interfaces are up - proceed with registration */
if (devs->active_if == FL2000_ALL_IFS) {
ret = component_master_add_with_match(&devs->adapter->dev, &fl2000_master_ops,
devs->match);
devs->match);
if (ret) {
dev_err(&usb_dev->dev, "Cannot register component master (%d)", ret);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion fl2000_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ struct i2c_adapter *fl2000_i2c_init(struct usb_device *usb_dev)

usb_make_path(usb_dev, usb_path, sizeof(usb_path));
dev_dbg(&usb_dev->dev, "Created FL2000 bridge I2C bus %d at interface %s",
i2c_adapter_id(adapter), usb_path);
i2c_adapter_id(adapter), usb_path);

return adapter;
}
4 changes: 2 additions & 2 deletions fl2000_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ struct fl2000_intr *fl2000_intr_create(struct usb_device *usb_dev, struct drm_de
}

/* Interrupt URB configuration is static, including allocated buffer */
usb_fill_int_urb(intr->urb, usb_dev, usb_rcvintpipe(usb_dev, 3),
intr->buf, INTR_BUFSIZE, fl2000_intr_completion, intr, intr->poll_interval);
usb_fill_int_urb(intr->urb, usb_dev, usb_rcvintpipe(usb_dev, 3), intr->buf, INTR_BUFSIZE,
fl2000_intr_completion, intr, intr->poll_interval);
intr->urb->transfer_dma = intr->transfer_dma;
intr->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; /* use urb->transfer_dma */

Expand Down
9 changes: 4 additions & 5 deletions fl2000_registers.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ static int fl2000_reg_read(void *context, unsigned int reg, unsigned int *val)
return -ENOMEM;

ret = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), CONTROL_MSG_READ,
(USB_DIR_IN | USB_TYPE_VENDOR), 0, offset, usb_rw_data,
sizeof(u32), USB_CTRL_GET_TIMEOUT);
(USB_DIR_IN | USB_TYPE_VENDOR), 0, offset, usb_rw_data, sizeof(u32),
USB_CTRL_GET_TIMEOUT);
if (ret > 0) {
if (ret != sizeof(u32))
ret = -1;
Expand Down Expand Up @@ -64,8 +64,8 @@ static int fl2000_reg_write(void *context, unsigned int reg, unsigned int val)
*usb_rw_data = val;

ret = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), CONTROL_MSG_WRITE,
(USB_DIR_OUT | USB_TYPE_VENDOR), 0, offset, usb_rw_data,
sizeof(u32), USB_CTRL_SET_TIMEOUT);
(USB_DIR_OUT | USB_TYPE_VENDOR), 0, offset, usb_rw_data, sizeof(u32),
USB_CTRL_SET_TIMEOUT);
if (ret > 0) {
if (ret != sizeof(u32))
ret = -1;
Expand Down Expand Up @@ -260,7 +260,6 @@ int fl2000_usb_magic(struct usb_device *usb_dev)
fl2000_add_bitmask(mask, union fl2000_usb_lpm_reg, u2_reject);
regmap_write_bits(regmap, FL2000_USB_LPM_REG, mask, usb_lpm_reg.val);


mask = 0;
usb_ctrl_reg.wake_nrdy = false;
fl2000_add_bitmask(mask, union fl2000_usb_ctrl_reg, wake_nrdy);
Expand Down
16 changes: 8 additions & 8 deletions fl2000_registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
union fl2000_usb_lpm_reg {
u32 val;
struct {
u32 __reserved1 : 13;
u32 __reserved1 : 13;
u32 magic : 1;
u32 __reserved2 : 5;
u32 __reserved2 : 5;
u32 u2_reject : 1;
u32 u1_reject : 1;
u32 __reserved3 : 11;
u32 __reserved3 : 11;
} __aligned(4) __packed;
};

#define FL2000_USB_CTRL_REG (FL2000_USB_CONTROL_OFFSET + 0x78)
union fl2000_usb_ctrl_reg {
u32 val;
struct {
u32 __reserved1 : 17;
u32 __reserved1 : 17;
u32 wake_nrdy : 1;
u32 __reserved2 : 14;
u32 __reserved2 : 14;
} __aligned(4) __packed;
};

Expand Down Expand Up @@ -289,7 +289,7 @@ union fl2000_rst_cntrl_reg {
u32 dis_hot_rst2_port : 1;
u32 dis_warm_rst2_port : 1;
u32 dis_hot_reset_pipe : 1;
u32 dis_warm_reset_pipe : 1;
u32 dis_warm_reset_pipe : 1;
u32 dis_hot_reset_pix : 1;
u32 dis_warm_reset_pix : 1;
u32 dis_usb2_reset_pix : 1;
Expand All @@ -299,8 +299,8 @@ union fl2000_rst_cntrl_reg {
u32 dis_sw_reset_buf : 1;
u32 dis_lbuf_reset_pix : 1;
u32 dis_hot_reset_port : 1;
u32 dis_warm_reset_port : 1;
u32 set_slow_clk_predft : 1;
u32 dis_warm_reset_port : 1;
u32 set_slow_clk_predft : 1;
u32 sw_reset : 1;
u32 frame_first_itp_wl : 16;
} __aligned(4) __packed;
Expand Down
6 changes: 3 additions & 3 deletions fl2000_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void fl2000_stream_put_buffers(struct fl2000_stream *stream)
{
struct fl2000_stream_buf *cur_sb, *temp_sb;

list_for_each_entry_safe (cur_sb, temp_sb, &stream->render_list, list) {
list_for_each_entry_safe(cur_sb, temp_sb, &stream->render_list, list) {
list_del(&cur_sb->list);
fl2000_free_sb(cur_sb);
}
Expand Down Expand Up @@ -194,10 +194,10 @@ static void fl2000_stream_work(struct work_struct *work)
if (list_empty(&stream->transmit_list)) {
if (list_empty(&stream->wait_list))
last_sb = list_last_entry(&stream->render_list,
struct fl2000_stream_buf, list);
struct fl2000_stream_buf, list);
else
last_sb = list_last_entry(&stream->wait_list,
struct fl2000_stream_buf, list);
struct fl2000_stream_buf, list);
cur_sb = list_first_entry(&stream->render_list, struct fl2000_stream_buf,
list);
memcpy(cur_sb->vaddr, last_sb->vaddr, stream->buf_size);
Expand Down

0 comments on commit ad56934

Please sign in to comment.