Skip to content

Commit a96301a

Browse files
hoshinolinajannau
authored andcommitted
media: apple: isp: t8112 fixes...
Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent b4f4838 commit a96301a

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

drivers/media/platform/apple/isp/isp-cam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static int isp_ch_configure_capture(struct apple_isp *isp, u32 ch)
346346
return err;
347347
}
348348

349-
if (isp->hw->gen >= ISP_GEN_T8112) {
349+
if (isp->hw->lpdp) {
350350
err = isp_cmd_ch_lpdp_hs_receiver_tuning_set(isp, ch, 1, 15);
351351
if (err)
352352
return err;
@@ -395,7 +395,7 @@ static int isp_ch_configure_capture(struct apple_isp *isp, u32 ch)
395395
if (err)
396396
return err;
397397

398-
err = isp_cmd_apple_ch_temporal_filter_start(isp, ch);
398+
err = isp_cmd_apple_ch_temporal_filter_start(isp, ch, isp->temporal_filter);
399399
if (err)
400400
return err;
401401

drivers/media/platform/apple/isp/isp-cmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ int isp_cmd_ch_buffer_pool_return(struct apple_isp *isp, u32 chan)
416416
return CISP_SEND_IN(isp, args);
417417
}
418418

419-
int isp_cmd_apple_ch_temporal_filter_start(struct apple_isp *isp, u32 chan)
419+
int isp_cmd_apple_ch_temporal_filter_start(struct apple_isp *isp, u32 chan, u32 arg)
420420
{
421421
struct cmd_apple_ch_temporal_filter_start args = {
422422
.opcode = CISP_OPCODE(CISP_CMD_APPLE_CH_TEMPORAL_FILTER_START),
423423
.chan = chan,
424424
.unk_c = 1,
425-
.unk_10 = 0,
425+
.unk_10 = arg,
426426
};
427427
return CISP_SEND_IN(isp, args);
428428
}

drivers/media/platform/apple/isp/isp-cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ struct cmd_apple_ch_temporal_filter_disable {
577577
} __packed;
578578
static_assert(sizeof(struct cmd_apple_ch_temporal_filter_disable) == 0xc);
579579

580-
int isp_cmd_apple_ch_temporal_filter_start(struct apple_isp *isp, u32 chan);
580+
int isp_cmd_apple_ch_temporal_filter_start(struct apple_isp *isp, u32 chan, u32 arg);
581581
int isp_cmd_apple_ch_temporal_filter_stop(struct apple_isp *isp, u32 chan);
582582
int isp_cmd_apple_ch_motion_history_start(struct apple_isp *isp, u32 chan);
583583
int isp_cmd_apple_ch_motion_history_stop(struct apple_isp *isp, u32 chan);

drivers/media/platform/apple/isp/isp-drv.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ static int apple_isp_probe(struct platform_device *pdev)
246246
return err;
247247
}
248248

249+
err = of_property_read_u32(dev->of_node, "apple,temporal-filter",
250+
&isp->temporal_filter);
251+
if (err)
252+
isp->temporal_filter = 0;
253+
249254
err = apple_isp_init_presets(isp);
250255
if (err) {
251256
dev_err(dev, "failed to initialize presets\n");
@@ -384,6 +389,7 @@ static const struct apple_isp_hw apple_isp_hw_t8103 = {
384389
.bandwidth_size = 0x4,
385390

386391
.scl1 = false,
392+
.lpdp = false,
387393
.meta_size = ISP_META_SIZE_T8103,
388394
};
389395

@@ -411,14 +417,14 @@ static const struct apple_isp_hw apple_isp_hw_t6000 = {
411417
.bandwidth_size = 0x8,
412418

413419
.scl1 = false,
420+
.lpdp = false,
414421
.meta_size = ISP_META_SIZE_T8103,
415422
};
416423

417424
static const struct apple_isp_hw apple_isp_hw_t8112 = {
418425
.gen = ISP_GEN_T8112,
419426
.pmu_base = 0x23b704000,
420427

421-
// TODO: verify
422428
.dsid_count = 1,
423429
.dsid_clr_base0 = 0x200f14000,
424430
.dsid_clr_range0 = 0x1000,
@@ -432,7 +438,8 @@ static const struct apple_isp_hw apple_isp_hw_t8112 = {
432438
.bandwidth_bit = 0x0,
433439
.bandwidth_size = 0x8,
434440

435-
.scl1 = true,
441+
.scl1 = false,
442+
.lpdp = false,
436443
.meta_size = ISP_META_SIZE_T8112,
437444
};
438445

@@ -454,6 +461,7 @@ static const struct apple_isp_hw apple_isp_hw_t6020 = {
454461
.bandwidth_size = 0x8,
455462

456463
.scl1 = true,
464+
.lpdp = true,
457465
.meta_size = ISP_META_SIZE_T8112,
458466
};
459467

drivers/media/platform/apple/isp/isp-drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ struct apple_isp_hw {
111111

112112
u32 meta_size;
113113
bool scl1;
114+
bool lpdp;
114115
};
115116

116117
enum isp_sensor_id {
@@ -178,6 +179,7 @@ struct apple_isp {
178179
struct device *dev;
179180
const struct apple_isp_hw *hw;
180181
u32 platform_id;
182+
u32 temporal_filter;
181183
struct isp_preset *presets;
182184
int num_presets;
183185

0 commit comments

Comments
 (0)