Skip to content

Commit

Permalink
Apply clang-format fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Kopeć <[email protected]>
  • Loading branch information
mkopec committed Jul 9, 2024
1 parent 19141dd commit deabfcc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/board/system76/common/dgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ int16_t dgpu_temp = 0;

#define DGPU_TEMP(X) ((int16_t)(X))

#define FAN_POINT(T, D) \
{ .temp = DGPU_TEMP(T), .duty = PWM_DUTY(D) }
#define FAN_POINT(T, D) { .temp = DGPU_TEMP(T), .duty = PWM_DUTY(D) }

// Fan curve with temperature in degrees C, duty cycle in percent
static struct FanPoint FAN_POINTS[] = {
Expand Down
8 changes: 4 additions & 4 deletions src/board/system76/common/include/board/peci.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#define PECI_PL_ENABLE BIT(15)
#define PECI_PL_CLAMP BIT(16)
#define PECI_PL_TIME_WINDOW(time, duty) \
((uint32_t)((time)&0x3f) << 17 | (uint32_t)((duty)&0xf) << 24)
((uint32_t)((time) & 0x3f) << 17 | (uint32_t)((duty) & 0xf) << 24)

#define PECI_PSYS_PL2(watts) ((watts)*8 | PECI_PL_ENABLE | PECI_PL_CLAMP)
#define PECI_PSYS_PL2(watts) ((watts) * 8 | PECI_PL_ENABLE | PECI_PL_CLAMP)
#define PECI_PL3(watts, time, duty) \
((watts)*8 | PECI_PL_ENABLE | PECI_PL_CLAMP | PECI_PL_TIME_WINDOW(time, duty))
#define PECI_PL4(watts) ((watts)*8)
((watts) * 8 | PECI_PL_ENABLE | PECI_PL_CLAMP | PECI_PL_TIME_WINDOW(time, duty))
#define PECI_PL4(watts) ((watts) * 8)

// Set the CPU power limit appropriately
extern bool peci_on;
Expand Down
2 changes: 1 addition & 1 deletion src/board/system76/common/usbpd/tps65987.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ enum {
PDO_KIND_AUGUMENTED,
};

#define PDO_CURRENT_MA(pdo) (((pdo)&0x3FF) * 10)
#define PDO_CURRENT_MA(pdo) (((pdo) & 0x3FF) * 10)

static int16_t usbpd_current_limit(uint8_t address) {
uint8_t value[7] = { 0 };
Expand Down
12 changes: 2 additions & 10 deletions src/ec/ite/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
// Based on chromium EC chip/it83xx/adc.c

const struct Vch adc_channels[] = {
VCH(0),
VCH(1),
VCH(2),
VCH(3),
VCH(4),
VCH(5),
VCH(6),
VCH(7),
VCH(0), VCH(1), VCH(2), VCH(3), VCH(4), VCH(5), VCH(6), VCH(7),
};

void adc_init(void) {
Expand Down Expand Up @@ -72,8 +65,7 @@ int16_t adc_read_channel(uint8_t ch) {
}
};

uint32_t measurement = (((*adc_channels[ch].data_hi) & 0x03) << 8)
| *adc_channels[ch].data_lo;
uint32_t measurement = (((*adc_channels[ch].data_hi) & 0x03) << 8) | *adc_channels[ch].data_lo;

adc_disable_channel(ch);

Expand Down

0 comments on commit deabfcc

Please sign in to comment.