[media] soc-camera: add host clock callbacks to start and stop the master clock
Currently soc-camera uses a single camera host callback to activate the interface master clock and to configure the interface for a specific client. However, during probing we might not have the information about a client, we just need to activate the clock. Add new camera host driver callbacks to only start and stop the clock without and client-specific configuration. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
f7f6ce2d09
commit
eb569cf9db
2 changed files with 20 additions and 3 deletions
|
@ -512,10 +512,23 @@ static int soc_camera_add_device(struct soc_camera_device *icd)
|
||||||
if (ici->icd)
|
if (ici->icd)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
if (ici->ops->clock_start) {
|
||||||
|
ret = ici->ops->clock_start(ici);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ici->ops->add(icd);
|
ret = ici->ops->add(icd);
|
||||||
if (!ret)
|
if (ret < 0)
|
||||||
|
goto eadd;
|
||||||
|
|
||||||
ici->icd = icd;
|
ici->icd = icd;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
eadd:
|
||||||
|
if (ici->ops->clock_stop)
|
||||||
|
ici->ops->clock_stop(ici);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,6 +540,8 @@ static void soc_camera_remove_device(struct soc_camera_device *icd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ici->ops->remove(icd);
|
ici->ops->remove(icd);
|
||||||
|
if (ici->ops->clock_stop)
|
||||||
|
ici->ops->clock_stop(ici);
|
||||||
ici->icd = NULL;
|
ici->icd = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,8 @@ struct soc_camera_host_ops {
|
||||||
struct module *owner;
|
struct module *owner;
|
||||||
int (*add)(struct soc_camera_device *);
|
int (*add)(struct soc_camera_device *);
|
||||||
void (*remove)(struct soc_camera_device *);
|
void (*remove)(struct soc_camera_device *);
|
||||||
|
int (*clock_start)(struct soc_camera_host *);
|
||||||
|
void (*clock_stop)(struct soc_camera_host *);
|
||||||
/*
|
/*
|
||||||
* .get_formats() is called for each client device format, but
|
* .get_formats() is called for each client device format, but
|
||||||
* .put_formats() is only called once. Further, if any of the calls to
|
* .put_formats() is only called once. Further, if any of the calls to
|
||||||
|
|
Loading…
Add table
Reference in a new issue