drm: sti: remove useless fields from vtg structure
Drivers are registered on platform bus so the private list could be replace by a call to of_find_device_by_node(). Changing this also makes dev, np and link fields useless in vtg structure. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/1510146255-24982-1-git-send-email-benjamin.gaignard@linaro.org
This commit is contained in:
parent
846c7dfc11
commit
cc6b741c6f
@ -8,5 +8,6 @@ config DRM_STI
|
|||||||
select DRM_PANEL
|
select DRM_PANEL
|
||||||
select FW_LOADER
|
select FW_LOADER
|
||||||
select SND_SOC_HDMI_CODEC if SND_SOC
|
select SND_SOC_HDMI_CODEC if SND_SOC
|
||||||
|
select OF
|
||||||
help
|
help
|
||||||
Choose this option to enable DRM on STM stiH4xx chipset
|
Choose this option to enable DRM on STM stiH4xx chipset
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/notifier.h>
|
#include <linux/notifier.h>
|
||||||
|
#include <linux/of_platform.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
@ -72,8 +73,6 @@
|
|||||||
#define AWG_DELAY_ED (-8)
|
#define AWG_DELAY_ED (-8)
|
||||||
#define AWG_DELAY_SD (-7)
|
#define AWG_DELAY_SD (-7)
|
||||||
|
|
||||||
static LIST_HEAD(vtg_lookup);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* STI VTG register offset structure
|
* STI VTG register offset structure
|
||||||
*
|
*
|
||||||
@ -123,42 +122,31 @@ struct sti_vtg_sync_params {
|
|||||||
/**
|
/**
|
||||||
* STI VTG structure
|
* STI VTG structure
|
||||||
*
|
*
|
||||||
* @dev: pointer to device driver
|
|
||||||
* @np: device node
|
|
||||||
* @regs: register mapping
|
* @regs: register mapping
|
||||||
* @sync_params: synchronisation parameters used to generate timings
|
* @sync_params: synchronisation parameters used to generate timings
|
||||||
* @irq: VTG irq
|
* @irq: VTG irq
|
||||||
* @irq_status: store the IRQ status value
|
* @irq_status: store the IRQ status value
|
||||||
* @notifier_list: notifier callback
|
* @notifier_list: notifier callback
|
||||||
* @crtc: the CRTC for vblank event
|
* @crtc: the CRTC for vblank event
|
||||||
* @link: List node to link the structure in lookup list
|
|
||||||
*/
|
*/
|
||||||
struct sti_vtg {
|
struct sti_vtg {
|
||||||
struct device *dev;
|
|
||||||
struct device_node *np;
|
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
struct sti_vtg_sync_params sync_params[VTG_MAX_SYNC_OUTPUT];
|
struct sti_vtg_sync_params sync_params[VTG_MAX_SYNC_OUTPUT];
|
||||||
int irq;
|
int irq;
|
||||||
u32 irq_status;
|
u32 irq_status;
|
||||||
struct raw_notifier_head notifier_list;
|
struct raw_notifier_head notifier_list;
|
||||||
struct drm_crtc *crtc;
|
struct drm_crtc *crtc;
|
||||||
struct list_head link;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void vtg_register(struct sti_vtg *vtg)
|
|
||||||
{
|
|
||||||
list_add_tail(&vtg->link, &vtg_lookup);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct sti_vtg *of_vtg_find(struct device_node *np)
|
struct sti_vtg *of_vtg_find(struct device_node *np)
|
||||||
{
|
{
|
||||||
struct sti_vtg *vtg;
|
struct platform_device *pdev;
|
||||||
|
|
||||||
list_for_each_entry(vtg, &vtg_lookup, link) {
|
pdev = of_find_device_by_node(np);
|
||||||
if (vtg->np == np)
|
if (!pdev)
|
||||||
return vtg;
|
return NULL;
|
||||||
}
|
|
||||||
return NULL;
|
return (struct sti_vtg *)platform_get_drvdata(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vtg_reset(struct sti_vtg *vtg)
|
static void vtg_reset(struct sti_vtg *vtg)
|
||||||
@ -397,9 +385,6 @@ static int vtg_probe(struct platform_device *pdev)
|
|||||||
if (!vtg)
|
if (!vtg)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
vtg->dev = dev;
|
|
||||||
vtg->np = pdev->dev.of_node;
|
|
||||||
|
|
||||||
/* Get Memory ressources */
|
/* Get Memory ressources */
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
@ -428,10 +413,9 @@ static int vtg_probe(struct platform_device *pdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtg_register(vtg);
|
|
||||||
platform_set_drvdata(pdev, vtg);
|
platform_set_drvdata(pdev, vtg);
|
||||||
|
|
||||||
DRM_INFO("%s %s\n", __func__, dev_name(vtg->dev));
|
DRM_INFO("%s %s\n", __func__, dev_name(dev));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user