Skip to content

Commit

Permalink
Merge branch 'master' into structural_adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
klogg authored Sep 10, 2024
2 parents ab8f40b + ed5a85b commit 5644d7d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bridge/it66121.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "it66121_registers.h"

#define UNUSED(x) (void)(x)
#define UNUSED(x) ((void)(x))

/* HW defect leading to losing 3 first bytes during EDID read operation */
#define EDID_LOSS_LEN 3
Expand Down
2 changes: 1 addition & 1 deletion fl2000.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#include "fl2000_registers.h"

#define UNUSED(x) (void)(x)
#define UNUSED(x) ((void)(x))

/* Known USB interfaces of FL2000 */
enum fl2000_interface {
Expand Down
13 changes: 6 additions & 7 deletions fl2000_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,14 @@ static u64 fl2000_pll_calc(u64 clock_mil, struct fl2000_pll *pll, u32 *clock_cal
pll->prescaler = prescaler;
pll->multiplier = multiplier;
pll->divisor = divisor;
if (vco_clk < 125000000) {
if (vco_clk < 125000000)
pll->function = 0;
} else if (vco_clk < 250000000) {
else if (vco_clk < 250000000)
pll->function = 1;
} else if (vco_clk < 500000000) {
else if (vco_clk < 500000000)
pll->function = 2;
} else {
else
pll->function = 3;
}
*clock_calculated = vco_clk / divisor;
}

Expand All @@ -212,8 +211,8 @@ static int fl2000_mode_calc(const struct drm_display_mode *mode,
return -1;

/* Try to match pixel clock slightly adjusting htotal value, sequence is:
0, -1, 1, -2, 2, -3, 3, -3, 4, -4, 5, -5, ...
Here, 's' is used for sign, 'm' is used for modulo, and 'd' is the adjustment value
* 0, -1, 1, -2, 2, -3, 3, -3, 4, -4, 5, -5, ...
* Here, 's' is used for sign, 'm' is used for modulo, and 'd' is the adjustment value
*/
for (int m = 0, s = 0, d = 0; m <= max_h_adjustment * 2; m++, s = -s, d += m * s) {
/* Maximum pixel clock 1GHz, or 10^9Hz. Multiply by 10^6 we get 10^15Hz. Assume
Expand Down
1 change: 1 addition & 0 deletions fl2000_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct fl2000_if_api

static int fl2000_avcontrol_create(struct usb_interface *interface)
{

struct usb_device *usb_dev = interface_to_usbdev(interface);
struct component_match *match = NULL;
int ret;
Expand Down
2 changes: 1 addition & 1 deletion fl2000_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ int fl2000_streaming_mode_set(struct usb_device *usb_dev, int pixels, u32 bytes_
}

/* Round buffer size up to multiple of 8 to meet HW expectations */
size = (pixels * bytes_pix + 7) & ~(unsigned int)7;
size = (pixels * bytes_pix + 7) & ~7U;

/* If there are buffers with same size - keep them */
if (stream->buf_size == size)
Expand Down

0 comments on commit 5644d7d

Please sign in to comment.