Skip to content

Commit

Permalink
Merge branch 'raspberrypi:rpi-6.1.y' into rpi-6.1.y
Browse files Browse the repository at this point in the history
  • Loading branch information
0lxb authored Jan 6, 2024
2 parents 13172ad + 146bbf9 commit 15c9eee
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 26 deletions.
15 changes: 15 additions & 0 deletions arch/arm/boot/dts/bcm2712-rpi-5-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,8 @@ spi10_cs_pins: &spi10_cs_gpio1 {};
act_led_trigger = <&act_led>, "linux,default-trigger";
pwr_led_activelow = <&pwr_led>, "gpios:8";
pwr_led_trigger = <&pwr_led>, "linux,default-trigger";
eth_led0 = <&phy1>,"led-modes:0";
eth_led1 = <&phy1>,"led-modes:4";
drm_fb0_rp1_dsi0 = <&aliases>, "drm-fb0=",&dsi0;
drm_fb0_rp1_dsi1 = <&aliases>, "drm-fb0=",&dsi1;
drm_fb0_rp1_dpi = <&aliases>, "drm-fb0=",&dpi;
Expand All @@ -842,5 +844,18 @@ spi10_cs_pins: &spi10_cs_gpio1 {};
drm_fb2_rp1_dsi1 = <&aliases>, "drm-fb2=",&dsi1;
drm_fb2_rp1_dpi = <&aliases>, "drm-fb2=",&dpi;
drm_fb2_vc4 = <&aliases>, "drm-fb2=",&vc4;

fan_temp0 = <&cpu_tepid>,"temperature:0";
fan_temp1 = <&cpu_warm>,"temperature:0";
fan_temp2 = <&cpu_hot>,"temperature:0";
fan_temp3 = <&cpu_vhot>,"temperature:0";
fan_temp0_hyst = <&cpu_tepid>,"hysteresis:0";
fan_temp1_hyst = <&cpu_warm>,"hysteresis:0";
fan_temp2_hyst = <&cpu_hot>,"hysteresis:0";
fan_temp3_hyst = <&cpu_vhot>,"hysteresis:0";
fan_temp0_speed = <&fan>, "cooling-levels:4";
fan_temp1_speed = <&fan>, "cooling-levels:8";
fan_temp2_speed = <&fan>, "cooling-levels:12";
fan_temp3_speed = <&fan>, "cooling-levels:16";
};
};
31 changes: 28 additions & 3 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Params:
0 means never downshift (default 2). Pi3B+ only.

eth_led0 Set mode of LED0 - amber on Pi3B+ (default "1"),
green on Pi4 (default "0").
green on Pi4/5 (default "0").
The legal values are:

Pi3B+
Expand All @@ -217,7 +217,7 @@ Params:
4=link100/1000/activity 5=link10/1000/activity
6=link10/100/activity 14=off 15=on

Pi4
Pi4/5

0=Speed/Activity 1=Speed
2=Flash activity 3=FDX
Expand All @@ -226,13 +226,38 @@ Params:
8=Link 9=Activity

eth_led1 Set mode of LED1 - green on Pi3B+ (default "6"),
amber on Pi4 (default "8"). See eth_led0 for
amber on Pi4/5 (default "8"). See eth_led0 for
legal values.

eth_max_speed Set the maximum speed a link is allowed
to negotiate. Legal values are 10, 100 and
1000 (default 1000). Pi3B+ only.

fan_temp0 Temperature threshold (in millicelcius) for
1st cooling level (default 50000). Pi5 only.
fan_temp0_hyst Temperature hysteresis (in millicelcius) for
1st cooling level (default 5000). Pi5 only.
fan_temp0_speed Fan PWM setting for 1st cooling level (0-255,
default 75). Pi5 only.
fan_temp1 Temperature threshold (in millicelcius) for
2nd cooling level (default 60000). Pi5 only.
fan_temp1_hyst Temperature hysteresis (in millicelcius) for
2nd cooling level (default 5000). Pi5 only.
fan_temp1_speed Fan PWM setting for 2nd cooling level (0-255,
default 125). Pi5 only.
fan_temp2 Temperature threshold (in millicelcius) for
3rd cooling level (default 67500). Pi5 only.
fan_temp2_hyst Temperature hysteresis (in millicelcius) for
3rd cooling level (default 5000). Pi5 only.
fan_temp2_speed Fan PWM setting for 3rd cooling level (0-255,
default 175). Pi5 only.
fan_temp3 Temperature threshold (in millicelcius) for
4th cooling level (default 75000). Pi5 only.
fan_temp3_hyst Temperature hysteresis (in millicelcius) for
4th cooling level (default 5000). Pi5 only.
fan_temp3_speed Fan PWM setting for 4th cooling level (0-255,
default 250). Pi5 only.

hdmi Set to "off" to disable the HDMI interface
(default "on")

Expand Down
23 changes: 21 additions & 2 deletions drivers/gpu/drm/vc4/vc4_hvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,10 +823,28 @@ u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo)
if (!drm_dev_enter(drm, &idx))
return 0;

if (vc4->gen >= VC4_GEN_6) {
switch (vc4->gen) {
case VC4_GEN_6:
field = VC4_GET_FIELD(HVS_READ(SCALER6_DISPX_STATUS(fifo)),
SCALER6_DISPX_STATUS_FRCNT);
} else {
break;
case VC4_GEN_5:
switch (fifo) {
case 0:
field = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTAT1),
SCALER5_DISPSTAT1_FRCNT0);
break;
case 1:
field = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTAT1),
SCALER5_DISPSTAT1_FRCNT1);
break;
case 2:
field = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTAT2),
SCALER5_DISPSTAT2_FRCNT2);
break;
}
break;
case VC4_GEN_4:
switch (fifo) {
case 0:
field = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTAT1),
Expand All @@ -841,6 +859,7 @@ u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo)
SCALER_DISPSTAT2_FRCNT2);
break;
}
break;
}

drm_dev_exit(idx);
Expand Down
5 changes: 1 addition & 4 deletions drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -2225,9 +2225,6 @@ static int vc4_prepare_fb(struct drm_plane *plane,

drm_gem_plane_helper_prepare_fb(plane, state);

if (plane->state->fb == state->fb)
return 0;

return vc4_bo_inc_usecnt(bo);
}

Expand All @@ -2236,7 +2233,7 @@ static void vc4_cleanup_fb(struct drm_plane *plane,
{
struct vc4_bo *bo;

if (plane->state->fb == state->fb || !state->fb)
if (!state->fb)
return;

bo = to_vc4_bo(&drm_fb_dma_get_gem_obj(state->fb, 0)->base);
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/vc4/vc4_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@
# define SCALER_DISPSTAT1_FRCNT0_SHIFT 18
# define SCALER_DISPSTAT1_FRCNT1_MASK VC4_MASK(17, 12)
# define SCALER_DISPSTAT1_FRCNT1_SHIFT 12
# define SCALER5_DISPSTAT1_FRCNT0_MASK VC4_MASK(25, 20)
# define SCALER5_DISPSTAT1_FRCNT0_SHIFT 20
# define SCALER5_DISPSTAT1_FRCNT1_MASK VC4_MASK(19, 14)
# define SCALER5_DISPSTAT1_FRCNT1_SHIFT 14

#define SCALER_DISPSTATX(x) (SCALER_DISPSTAT0 + \
(x) * (SCALER_DISPSTAT1 - \
Expand All @@ -442,6 +446,8 @@
#define SCALER_DISPSTAT2 0x00000068
# define SCALER_DISPSTAT2_FRCNT2_MASK VC4_MASK(17, 12)
# define SCALER_DISPSTAT2_FRCNT2_SHIFT 12
# define SCALER5_DISPSTAT2_FRCNT2_MASK VC4_MASK(19, 14)
# define SCALER5_DISPSTAT2_FRCNT2_SHIFT 14

#define SCALER_DISPBASE2 0x0000006c
#define SCALER_DISPALPHA2 0x00000070
Expand Down
38 changes: 21 additions & 17 deletions sound/soc/dwc/dwc-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,25 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}

if ((dev->capability & DW_I2S_MASTER) && dev->bclk_ratio) {
switch (dev->bclk_ratio) {
case 32:
dev->ccr = 0x00;
break;

case 48:
dev->ccr = 0x08;
break;

case 64:
dev->ccr = 0x10;
break;

default:
return -EINVAL;
}
}

config->chan_nr = params_channels(params);

switch (config->chan_nr) {
Expand Down Expand Up @@ -436,23 +455,7 @@ static int dw_i2s_set_bclk_ratio(struct snd_soc_dai *cpu_dai,

dev_dbg(dev->dev, "%s(%d)\n", __func__, ratio);

switch (ratio) {
case 32:
dev->ccr = 0x00;
break;

case 48:
dev->ccr = 0x08;
break;

case 64:
dev->ccr = 0x10;
break;
default:
return -EINVAL;
}

i2s_write_reg(dev->i2s_base, CCR, dev->ccr);
dev->bclk_ratio = ratio;

return 0;
}
Expand Down Expand Up @@ -746,6 +749,7 @@ static int dw_i2s_probe(struct platform_device *pdev)
}
}

dev->bclk_ratio = 0;
dev->i2s_reg_comp1 = I2S_COMP_PARAM_1;
dev->i2s_reg_comp2 = I2S_COMP_PARAM_2;
if (pdata) {
Expand Down
1 change: 1 addition & 0 deletions sound/soc/dwc/local.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ struct dw_i2s_dev {
unsigned int quirks;
unsigned int i2s_reg_comp1;
unsigned int i2s_reg_comp2;
unsigned int bclk_ratio;
struct device *dev;
u32 ccr;
u32 xfer_resolution;
Expand Down

0 comments on commit 15c9eee

Please sign in to comment.