|
16 | 16 | #include <linux/property.h> |
17 | 17 | #include <linux/slab.h> |
18 | 18 | #include <linux/string.h> |
19 | | -#include <linux/sys_soc.h> |
20 | 19 | #include <linux/types.h> |
21 | 20 |
|
22 | 21 | #include <media/media-device.h> |
@@ -244,27 +243,7 @@ static void mxc_isi_v4l2_cleanup(struct mxc_isi_dev *isi) |
244 | 243 | * Device information |
245 | 244 | */ |
246 | 245 |
|
247 | | -/* For i.MX8QM/QXP B0 ISI IER version */ |
248 | | -static const struct mxc_isi_ier_reg mxc_imx8_isi_ier_v0 = { |
249 | | - .oflw_y_buf_en = { .offset = 16, .mask = 0x10000 }, |
250 | | - .oflw_u_buf_en = { .offset = 19, .mask = 0x80000 }, |
251 | | - .oflw_v_buf_en = { .offset = 22, .mask = 0x400000 }, |
252 | | - |
253 | | - .excs_oflw_y_buf_en = { .offset = 17, .mask = 0x20000 }, |
254 | | - .excs_oflw_u_buf_en = { .offset = 20, .mask = 0x100000 }, |
255 | | - .excs_oflw_v_buf_en = { .offset = 23, .mask = 0x800000 }, |
256 | | - |
257 | | - .panic_y_buf_en = {.offset = 18, .mask = 0x40000 }, |
258 | | - .panic_u_buf_en = {.offset = 21, .mask = 0x200000 }, |
259 | | - .panic_v_buf_en = {.offset = 24, .mask = 0x1000000 }, |
260 | | -}; |
261 | | - |
262 | 246 | /* Panic will assert when the buffers are 50% full */ |
263 | | -static const struct mxc_isi_set_thd mxc_imx8_isi_thd_v0 = { |
264 | | - .panic_set_thd_y = { .mask = 0x03, .offset = 0, .threshold = 0x2 }, |
265 | | - .panic_set_thd_u = { .mask = 0x18, .offset = 3, .threshold = 0x2 }, |
266 | | - .panic_set_thd_v = { .mask = 0xc0, .offset = 6, .threshold = 0x2 }, |
267 | | -}; |
268 | 247 |
|
269 | 248 | /* For i.MX8QXP C0 and i.MX8MN ISI IER version */ |
270 | 249 | static const struct mxc_isi_ier_reg mxc_imx8_isi_ier_v1 = { |
@@ -295,39 +274,6 @@ static const struct mxc_isi_set_thd mxc_imx8_isi_thd_v1 = { |
295 | 274 | .panic_set_thd_v = { .mask = 0xf0000, .offset = 16, .threshold = 0x7 }, |
296 | 275 | }; |
297 | 276 |
|
298 | | -static const struct clk_bulk_data mxc_imx8_clks[] = { |
299 | | - { .id = NULL }, |
300 | | -}; |
301 | | - |
302 | | -/* Chip C0 */ |
303 | | -static const struct mxc_isi_plat_data mxc_imx8_data_v0 = { |
304 | | - .model = MXC_ISI_IMX8, |
305 | | - .num_ports = 5, |
306 | | - .num_channels = 8, |
307 | | - .reg_offset = 0x10000, |
308 | | - .ier_reg = &mxc_imx8_isi_ier_v0, |
309 | | - .set_thd = &mxc_imx8_isi_thd_v0, |
310 | | - .clks = mxc_imx8_clks, |
311 | | - .num_clks = ARRAY_SIZE(mxc_imx8_clks), |
312 | | - .buf_active_reverse = false, |
313 | | - .has_gasket = false, |
314 | | - .has_36bit_dma = false, |
315 | | -}; |
316 | | - |
317 | | -static const struct mxc_isi_plat_data mxc_imx8_data_v1 = { |
318 | | - .model = MXC_ISI_IMX8, |
319 | | - .num_ports = 5, |
320 | | - .num_channels = 8, |
321 | | - .reg_offset = 0x10000, |
322 | | - .ier_reg = &mxc_imx8_isi_ier_v1, |
323 | | - .set_thd = &mxc_imx8_isi_thd_v1, |
324 | | - .clks = mxc_imx8_clks, |
325 | | - .num_clks = ARRAY_SIZE(mxc_imx8_clks), |
326 | | - .buf_active_reverse = true, |
327 | | - .has_gasket = false, |
328 | | - .has_36bit_dma = false, |
329 | | -}; |
330 | | - |
331 | 277 | static const struct clk_bulk_data mxc_imx8mn_clks[] = { |
332 | 278 | { .id = "axi" }, |
333 | 279 | { .id = "apb" }, |
@@ -361,53 +307,6 @@ static const struct mxc_isi_plat_data mxc_imx8mp_data = { |
361 | 307 | .has_36bit_dma = true, |
362 | 308 | }; |
363 | 309 |
|
364 | | -static const struct soc_device_attribute imx8_soc[] = { |
365 | | - { |
366 | | - .soc_id = "i.MX8QXP", |
367 | | - .revision = "1.0", |
368 | | - .data = &mxc_imx8_data_v0, |
369 | | - }, { |
370 | | - .soc_id = "i.MX8QXP", |
371 | | - .revision = "1.1", |
372 | | - .data = &mxc_imx8_data_v0, |
373 | | - }, { |
374 | | - .soc_id = "i.MX8QXP", |
375 | | - .revision = "1.2", |
376 | | - }, { |
377 | | - .soc_id = "i.MX8QM", |
378 | | - .revision = "1.0", |
379 | | - .data = &mxc_imx8_data_v0, |
380 | | - }, { |
381 | | - .soc_id = "i.MX8QM", |
382 | | - .revision = "1.1", |
383 | | - .data = &mxc_imx8_data_v0, |
384 | | - }, { |
385 | | - .soc_id = "i.MX8MN", |
386 | | - .revision = "1.0", |
387 | | - }, { |
388 | | - .soc_id = "i.MX8MP", |
389 | | - }, { |
390 | | - /* sentinel */ |
391 | | - } |
392 | | -}; |
393 | | - |
394 | | -static int mxc_isi_get_platform_data(struct mxc_isi_dev *isi) |
395 | | - |
396 | | -{ |
397 | | - const struct soc_device_attribute *match; |
398 | | - |
399 | | - isi->pdata = of_device_get_match_data(isi->dev); |
400 | | - |
401 | | - match = soc_device_match(imx8_soc); |
402 | | - if (!match) |
403 | | - return -EINVAL; |
404 | | - |
405 | | - if (match->data) |
406 | | - isi->pdata = match->data; |
407 | | - |
408 | | - return 0; |
409 | | -} |
410 | | - |
411 | 310 | /* ----------------------------------------------------------------------------- |
412 | 311 | * Power management |
413 | 312 | */ |
@@ -525,11 +424,7 @@ static int mxc_isi_probe(struct platform_device *pdev) |
525 | 424 | isi->dev = dev; |
526 | 425 | platform_set_drvdata(pdev, isi); |
527 | 426 |
|
528 | | - ret = mxc_isi_get_platform_data(isi); |
529 | | - if (ret < 0) { |
530 | | - dev_err(dev, "Can't get platform device data\n"); |
531 | | - return ret; |
532 | | - } |
| 427 | + isi->pdata = of_device_get_match_data(dev); |
533 | 428 |
|
534 | 429 | isi->pipes = kcalloc(isi->pdata->num_channels, sizeof(isi->pipes[0]), |
535 | 430 | GFP_KERNEL); |
@@ -621,7 +516,6 @@ static int mxc_isi_remove(struct platform_device *pdev) |
621 | 516 | } |
622 | 517 |
|
623 | 518 | static const struct of_device_id mxc_isi_of_match[] = { |
624 | | - { .compatible = "fsl,imx8-isi", .data = &mxc_imx8_data_v1 }, |
625 | 519 | { .compatible = "fsl,imx8mn-isi", .data = &mxc_imx8mn_data }, |
626 | 520 | { .compatible = "fsl,imx8mp-isi", .data = &mxc_imx8mp_data }, |
627 | 521 | { /* sentinel */ }, |
|
0 commit comments