Skip to content

Commit 75c067a

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

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
@@ -237,6 +237,11 @@ static int apple_isp_probe(struct platform_device *pdev)
237237
return err;
238238
}
239239

240+
err = of_property_read_u32(dev->of_node, "apple,temporal-filter",
241+
&isp->temporal_filter);
242+
if (err)
243+
isp->temporal_filter = 0;
244+
240245
err = apple_isp_init_presets(isp);
241246
if (err) {
242247
dev_err(dev, "failed to initialize presets\n");
@@ -375,6 +380,7 @@ static const struct apple_isp_hw apple_isp_hw_t8103 = {
375380
.bandwidth_size = 0x4,
376381

377382
.scl1 = false,
383+
.lpdp = false,
378384
.meta_size = ISP_META_SIZE_T8103,
379385
};
380386

@@ -402,14 +408,14 @@ static const struct apple_isp_hw apple_isp_hw_t6000 = {
402408
.bandwidth_size = 0x8,
403409

404410
.scl1 = false,
411+
.lpdp = false,
405412
.meta_size = ISP_META_SIZE_T8103,
406413
};
407414

408415
static const struct apple_isp_hw apple_isp_hw_t8112 = {
409416
.gen = ISP_GEN_T8112,
410417
.pmu_base = 0x23b704000,
411418

412-
// TODO: verify
413419
.dsid_count = 1,
414420
.dsid_clr_base0 = 0x200f14000,
415421
.dsid_clr_range0 = 0x1000,
@@ -423,7 +429,8 @@ static const struct apple_isp_hw apple_isp_hw_t8112 = {
423429
.bandwidth_bit = 0x0,
424430
.bandwidth_size = 0x8,
425431

426-
.scl1 = true,
432+
.scl1 = false,
433+
.lpdp = false,
427434
.meta_size = ISP_META_SIZE_T8112,
428435
};
429436

@@ -445,6 +452,7 @@ static const struct apple_isp_hw apple_isp_hw_t6020 = {
445452
.bandwidth_size = 0x8,
446453

447454
.scl1 = true,
455+
.lpdp = true,
448456
.meta_size = ISP_META_SIZE_T8112,
449457
};
450458

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)