Skip to content

Commit 399b7dd

Browse files
hoshinolinamarcan
authored andcommitted
media: apple: isp: Add flicker_sensor_set cmd
Signed-off-by: Asahi Lina <[email protected]>
1 parent d7ed3bd commit 399b7dd

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

drivers/iommu/io-pgtable-dart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ static int dart_init_pte(struct dart_io_pgtable *data,
140140
pte |= FIELD_PREP(APPLE_DART_PTE_SUBPAGE_START, 0);
141141
pte |= FIELD_PREP(APPLE_DART_PTE_SUBPAGE_END, 0xfff);
142142

143-
pte |= APPLE_DART1_PTE_PROT_SP_DIS;
144143
pte |= APPLE_DART_PTE_VALID;
145144

146145
for (i = 0; i < num_entries; i++)
@@ -216,6 +215,7 @@ static dart_iopte dart_prot_to_pte(struct dart_io_pgtable *data,
216215
dart_iopte pte = 0;
217216

218217
if (data->iop.fmt == APPLE_DART) {
218+
pte |= APPLE_DART1_PTE_PROT_SP_DIS;
219219
if (!(prot & IOMMU_WRITE))
220220
pte |= APPLE_DART1_PTE_PROT_NO_WRITE;
221221
if (!(prot & IOMMU_READ))

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define CISP_SEND_INOUT(x, a) (cisp_send((x), &(a), sizeof(a), sizeof(a), CISP_TIMEOUT))
1515
#define CISP_SEND_OUT(x, a) (cisp_send_read((x), (a), sizeof(*a), sizeof(*a)))
1616
#define CISP_POST_IN(x, a) (cisp_send((x), &(a), sizeof(a), 0, 0))
17+
#define CISP_POST_INOUT(x, a) (cisp_send((x), &(a), sizeof(a), sizeof(a), 0))
1718

1819
static int cisp_send(struct apple_isp *isp, void *args, u32 insize, u32 outsize, int timeout)
1920
{
@@ -204,6 +205,15 @@ int isp_cmd_ch_stop(struct apple_isp *isp, u32 chan)
204205
return CISP_SEND_IN(isp, args);
205206
}
206207

208+
int isp_cmd_flicker_sensor_set(struct apple_isp *isp, u32 mode)
209+
{
210+
struct cmd_flicker_sensor_set args = {
211+
.opcode = CISP_OPCODE(CISP_CMD_FLICKER_SENSOR_SET),
212+
.mode = mode,
213+
};
214+
return CISP_SEND_INOUT(isp, args);
215+
}
216+
207217
int isp_cmd_ch_info_get(struct apple_isp *isp, u32 chan,
208218
struct cmd_ch_info *args)
209219
{

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ struct cmd_ipc_endpoint_set2 {
232232
} __packed;
233233
static_assert(sizeof(struct cmd_ipc_endpoint_set2) == 0x30);
234234

235+
struct cmd_flicker_sensor_set {
236+
u64 opcode;
237+
u32 mode;
238+
} __packed;
239+
static_assert(sizeof(struct cmd_flicker_sensor_set) == 0xc);
240+
235241
int isp_cmd_start(struct apple_isp *isp, u32 mode);
236242
int isp_cmd_stop(struct apple_isp *isp, u32 mode);
237243
int isp_cmd_power_down(struct apple_isp *isp);
@@ -253,6 +259,7 @@ int isp_cmd_pmp_ctrl_set(struct apple_isp *isp, u64 clock_scratch,
253259
u8 bandwidth_bit, u8 bandwidth_size);
254260
int isp_cmd_fid_enter(struct apple_isp *isp);
255261
int isp_cmd_fid_exit(struct apple_isp *isp);
262+
int isp_cmd_flicker_sensor_set(struct apple_isp *isp, u32 mode);
256263

257264
struct cmd_ch_start {
258265
u64 opcode;

0 commit comments

Comments
 (0)