No source file but the driver itself includes the header containing the platform data definition. The last user is gone since commit 8485adf17a15 ("ARM: imx: Remove imx device directory"). So we can safely drop platform data support.
Unified · Split
| @@ -656,7 +656,6 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf · 655 unmodified lines | |||
| 656 | 656 | ||
| 657 | static int imxfb_init_fbinfo(struct platform_device *pdev) | 657 | static int imxfb_init_fbinfo(struct platform_device *pdev) |
| 658 | { | 658 | { |
| 659 | struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev); | ||
| 660 | struct fb_info *info = platform_get_drvdata(pdev); | 659 | struct fb_info *info = platform_get_drvdata(pdev); |
| 661 | struct imxfb_info *fbi = info->par; | 660 | struct imxfb_info *fbi = info->par; |
| 662 | struct device_node *np; | 661 | struct device_node *np; |
| @@ -690,25 +689,20 @@ static int imxfb_init_fbinfo(struct platform_device *pdev) · 27 unmodified lines | |||
| 690 | info->fbops = &imxfb_ops; | 689 | info->fbops = &imxfb_ops; |
| 691 | info->flags = FBINFO_FLAG_DEFAULT | | 690 | info->flags = FBINFO_FLAG_DEFAULT | |
| 692 | FBINFO_READS_FAST; | 691 | FBINFO_READS_FAST; |
| 693 | if (pdata) { | ||
| 694 | fbi->lscr1 = pdata->lscr1; | ||
| 695 | fbi->dmacr = pdata->dmacr; | ||
| 696 | fbi->pwmr = pdata->pwmr; | ||
| 697 | } else { | ||
| 698 | np = pdev->dev.of_node; | ||
| 699 | info->var.grayscale = of_property_read_bool(np, | ||
| 700 | "cmap-greyscale"); | ||
| 701 | fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse"); | ||
| 702 | fbi->cmap_static = of_property_read_bool(np, "cmap-static"); | ||
| 703 | 692 | ||
| 704 | fbi->lscr1 = IMXFB_LSCR1_DEFAULT; | 693 | np = pdev->dev.of_node; |
| 694 | info->var.grayscale = of_property_read_bool(np, | ||
| 695 | "cmap-greyscale"); | ||
| 696 | fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse"); | ||
| 697 | fbi->cmap_static = of_property_read_bool(np, "cmap-static"); | ||
| 705 | 698 | ||
| 706 | of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr); | 699 | fbi->lscr1 = IMXFB_LSCR1_DEFAULT; |
| 707 | 700 | ||
| 708 | of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1); | 701 | of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr); |
| 709 | 702 | ||
| 710 | of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr); | 703 | of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1); |
| 711 | } | 704 | |
| 705 | of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr); | ||
| 712 | 706 | ||
| 713 | return 0; | 707 | return 0; |
| 714 | } | 708 | } |
| @@ -863,10 +857,10 @@ static int imxfb_probe(struct platform_device *pdev) · 148 unmodified lines | |||
| 863 | struct imxfb_info *fbi; | 857 | struct imxfb_info *fbi; |
| 864 | struct lcd_device *lcd; | 858 | struct lcd_device *lcd; |
| 865 | struct fb_info *info; | 859 | struct fb_info *info; |
| 866 | struct imx_fb_platform_data *pdata; | ||
| 867 | struct resource *res; | 860 | struct resource *res; |
| 868 | struct imx_fb_videomode *m; | 861 | struct imx_fb_videomode *m; |
| 869 | const struct of_device_id *of_id; | 862 | const struct of_device_id *of_id; |
| 863 | struct device_node *display_np; | ||
| 870 | int ret, i; | 864 | int ret, i; |
| 871 | int bytes_per_pixel; | 865 | int bytes_per_pixel; |
| 872 | 866 | ||
| @@ -884,8 +878,6 @@ static int imxfb_probe(struct platform_device *pdev) · 11 unmodified lines | |||
| 884 | if (!res) | 878 | if (!res) |
| 885 | return -ENODEV; | 879 | return -ENODEV; |
| 886 | 880 | ||
| 887 | pdata = dev_get_platdata(&pdev->dev); | ||
| 888 | |||
| 889 | info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); | 881 | info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); |
| 890 | if (!info) | 882 | if (!info) |
| 891 | return -ENOMEM; | 883 | return -ENOMEM; |
| @@ -898,43 +890,34 @@ static int imxfb_probe(struct platform_device *pdev) · 6 unmodified lines | |||
| 898 | if (ret < 0) | 890 | if (ret < 0) |
| 899 | goto failed_init; | 891 | goto failed_init; |
| 900 | 892 | ||
| 901 | if (pdata) { | 893 | fb_mode = NULL; |
| 902 | if (!fb_mode) | ||
| 903 | fb_mode = pdata->mode[0].mode.name; | ||
| 904 | |||
| 905 | fbi->mode = pdata->mode; | ||
| 906 | fbi->num_modes = pdata->num_modes; | ||
| 907 | } else { | ||
| 908 | struct device_node *display_np; | ||
| 909 | fb_mode = NULL; | ||
| 910 | |||
| 911 | display_np = of_parse_phandle(pdev->dev.of_node, "display", 0); | ||
| 912 | if (!display_np) { | ||
| 913 | dev_err(&pdev->dev, "No display defined in devicetree\n"); | ||
| 914 | ret = -EINVAL; | ||
| 915 | goto failed_of_parse; | ||
| 916 | } | ||
| 917 | 894 | ||
| 918 | /* | 895 | display_np = of_parse_phandle(pdev->dev.of_node, "display", 0); |
| 919 | * imxfb does not support more modes, we choose only the native | 896 | if (!display_np) { |
| 920 | * mode. | 897 | dev_err(&pdev->dev, "No display defined in devicetree\n"); |
| 921 | */ | 898 | ret = -EINVAL; |
| 922 | fbi->num_modes = 1; | 899 | goto failed_of_parse; |
| 923 | 900 | } | |
| 924 | fbi->mode = devm_kzalloc(&pdev->dev, | ||
| 925 | sizeof(struct imx_fb_videomode), GFP_KERNEL); | ||
| 926 | if (!fbi->mode) { | ||
| 927 | ret = -ENOMEM; | ||
| 928 | of_node_put(display_np); | ||
| 929 | goto failed_of_parse; | ||
| 930 | } | ||
| 931 | 901 | ||
| 932 | ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode); | 902 | /* |
| 903 | * imxfb does not support more modes, we choose only the native | ||
| 904 | * mode. | ||
| 905 | */ | ||
| 906 | fbi->num_modes = 1; | ||
| 907 | |||
| 908 | fbi->mode = devm_kzalloc(&pdev->dev, | ||
| 909 | sizeof(struct imx_fb_videomode), GFP_KERNEL); | ||
| 910 | if (!fbi->mode) { | ||
| 911 | ret = -ENOMEM; | ||
| 933 | of_node_put(display_np); | 912 | of_node_put(display_np); |
| 934 | if (ret) | 913 | goto failed_of_parse; |
| 935 | goto failed_of_parse; | ||
| 936 | } | 914 | } |
| 937 | 915 | ||
| 916 | ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode); | ||
| 917 | of_node_put(display_np); | ||
| 918 | if (ret) | ||
| 919 | goto failed_of_parse; | ||
| 920 | |||
| 938 | /* Calculate maximum bytes used per pixel. In most cases this should | 921 | /* Calculate maximum bytes used per pixel. In most cases this should |
| 939 | * be the same as m->bpp/8 */ | 922 | * be the same as m->bpp/8 */ |
| 940 | m = &fbi->mode[0]; | 923 | m = &fbi->mode[0]; |
| @@ -1001,13 +984,6 @@ static int imxfb_probe(struct platform_device *pdev) · 60 unmodified lines | |||
| 1001 | 984 | ||
| 1002 | info->fix.smem_start = fbi->map_dma; | 985 | info->fix.smem_start = fbi->map_dma; |
| 1003 | 986 | ||
| 1004 | if (pdata && pdata->init) { | ||
| 1005 | ret = pdata->init(fbi->pdev); | ||
| 1006 | if (ret) | ||
| 1007 | goto failed_platform_init; | ||
| 1008 | } | ||
| 1009 | |||
| 1010 | |||
| 1011 | INIT_LIST_HEAD(&info->modelist); | 987 | INIT_LIST_HEAD(&info->modelist); |
| 1012 | for (i = 0; i < fbi->num_modes; i++) | 988 | for (i = 0; i < fbi->num_modes; i++) |
| 1013 | fb_add_videomode(&fbi->mode[i].mode, &info->modelist); | 989 | fb_add_videomode(&fbi->mode[i].mode, &info->modelist); |
| @@ -1059,9 +1035,6 @@ failed_lcd: · 45 unmodified lines | |||
| 1059 | failed_register: | 1035 | failed_register: |
| 1060 | fb_dealloc_cmap(&info->cmap); | 1036 | fb_dealloc_cmap(&info->cmap); |
| 1061 | failed_cmap: | 1037 | failed_cmap: |
| 1062 | if (pdata && pdata->exit) | ||
| 1063 | pdata->exit(fbi->pdev); | ||
| 1064 | failed_platform_init: | ||
| 1065 | dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, | 1038 | dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, |
| 1066 | fbi->map_dma); | 1039 | fbi->map_dma); |
| 1067 | failed_map: | 1040 | failed_map: |
| @@ -1079,7 +1052,6 @@ failed_init: · 11 unmodified lines | |||
| 1079 | 1052 | ||
| 1080 | static int imxfb_remove(struct platform_device *pdev) | 1053 | static int imxfb_remove(struct platform_device *pdev) |
| 1081 | { | 1054 | { |
| 1082 | struct imx_fb_platform_data *pdata; | ||
| 1083 | struct fb_info *info = platform_get_drvdata(pdev); | 1055 | struct fb_info *info = platform_get_drvdata(pdev); |
| 1084 | struct imxfb_info *fbi = info->par; | 1056 | struct imxfb_info *fbi = info->par; |
| 1085 | struct resource *res; | 1057 | struct resource *res; |
| @@ -1092,9 +1064,6 @@ static int imxfb_remove(struct platform_device *pdev) · 6 unmodified lines | |||
| 1092 | 1064 | ||
| 1093 | unregister_framebuffer(info); | 1065 | unregister_framebuffer(info); |
| 1094 | fb_dealloc_cmap(&info->cmap); | 1066 | fb_dealloc_cmap(&info->cmap); |
| 1095 | pdata = dev_get_platdata(&pdev->dev); | ||
| 1096 | if (pdata && pdata->exit) | ||
| 1097 | pdata->exit(fbi->pdev); | ||
| 1098 | dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, | 1067 | dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, |
| 1099 | fbi->map_dma); | 1068 | fbi->map_dma); |
| 1100 | iounmap(fbi->regs); | 1069 | iounmap(fbi->regs); |
| @@ -55,16 +55,4 @@ struct imx_fb_videomode { · 54 unmodified lines | |||
| 55 | unsigned char bpp; | 55 | unsigned char bpp; |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | struct imx_fb_platform_data { | ||
| 59 | struct imx_fb_videomode *mode; | ||
| 60 | int num_modes; | ||
| 61 | |||
| 62 | u_int pwmr; | ||
| 63 | u_int lscr1; | ||
| 64 | u_int dmacr; | ||
| 65 | |||
| 66 | int (*init)(struct platform_device *); | ||
| 67 | void (*exit)(struct platform_device *); | ||
| 68 | }; | ||
| 69 | |||
| 70 | #endif /* ifndef __MACH_IMXFB_H__ */ | 58 | #endif /* ifndef __MACH_IMXFB_H__ */ |