type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
includes |
#include <sound/driver.h> |
includes | #include <asm/io.h> |
includes | #include <linux/delay.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/init.h> |
includes | #include <linux/slab.h> |
includes | #include <sound/core.h> |
functions | void revo_set_rate_val(akm4xxx_t *ak, unsigned int rate)
{
unsigned char old, tmp, dfs;
int reg, shift;
if (rate == 0) /* no hint - S/PDIF input is master, simply return */
return;
/* adjust DFS on codecs */
if (rate > 96000)
dfs = 2;
else if (rate > 48000)
dfs = 1;
else
dfs = 0;
if (ak->type == SND_... |
functions | __devinit revo_init(ice1712_t *ice)
{
akm4xxx_t *ak;
int err;
/* determine I2C, DACs and ADCs */
switch (ice->eeprom.subvendor) {
case VT1724_SUBDEVICE_REVOLUTION71:
ice->num_total_dacs = 8;
ice->num_total_adcs = 2;
break;
default:
snd_BUG();
return -EINVAL;
} |
functions | __devinit revo_add_controls(ice1712_t *ice)
{
int err;
switch (ice->eeprom.subvendor) {
case VT1724_SUBDEVICE_REVOLUTION71:
err = snd_ice1712_akm4xxx_build_controls(ice);
if (err < 0)
return err;
} |
functions | int zqrdc_(doublecomplex *x, integer *ldx, integer *n,
integer *p, doublecomplex *qraux, integer *jpvt, doublecomplex *work,
integer *job)
{
/* System generated locals */
integer x_dim1, x_offset, i__1, i__2, i__3, i__4;
doublereal d__1, d__2, d__3, d__4;
doublecomplex z__1, z__2, z__3;
... |
includes |
#include <linux/platform_data/gpio-omap.h> |
includes | #include <linux/omap-dma.h> |
includes | #include <plat/dmtimer.h> |
includes | #include <linux/platform_data/spi-omap2-mcspi.h> |
includes | #include <linux/clk.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/io.h> |
includes | #include <linux/iopoll.h> |
includes | #include <linux/irq.h> |
includes | #include <linux/module.h> |
includes | #include <linux/of_graph.h> |
includes | #include <linux/platform_device.h> |
includes | #include <media/v4l2-device.h> |
includes | #include <media/v4l2-fwnode.h> |
includes | #include <media/v4l2-subdev.h> |
defines | #define CSI2_SINK_PAD 0 |
defines | #define CSI2_NUM_SINK_PADS 1 |
defines | #define CSI2_NUM_SRC_PADS 4 |
defines | #define CSI2_NUM_PADS 5 |
defines | #define CSI2_DEFAULT_MAX_MBPS 849 |
defines |
#define DEVICE_NAME "imx6-mipi-csi2" |
defines | #define CSI2_VERSION 0x000 |
defines | #define CSI2_N_LANES 0x004 |
defines | #define CSI2_PHY_SHUTDOWNZ 0x008 |
defines | #define CSI2_DPHY_RSTZ 0x00c |
defines | #define CSI2_RESETN 0x010 |
defines | #define CSI2_PHY_STATE 0x014 |
defines | #define PHY_STOPSTATEDATA_BIT 4 |
defines | #define PHY_STOPSTATEDATA(n) BIT(PHY_STOPSTATEDATA_BIT + (n)) |
defines | #define PHY_RXCLKACTIVEHS BIT(8) |
defines | #define PHY_RXULPSCLKNOT BIT(9) |
defines | #define PHY_STOPSTATECLK BIT(10) |
defines | #define CSI2_DATA_IDS_1 0x018 |
defines | #define CSI2_DATA_IDS_2 0x01c |
defines | #define CSI2_ERR1 0x020 |
defines | #define CSI2_ERR2 0x024 |
defines | #define CSI2_MSK1 0x028 |
defines | #define CSI2_MSK2 0x02c |
defines | #define CSI2_PHY_TST_CTRL0 0x030 |
defines | #define PHY_TESTCLR BIT(0) |
defines | #define PHY_TESTCLK BIT(1) |
defines | #define CSI2_PHY_TST_CTRL1 0x034 |
defines | #define PHY_TESTEN BIT(16) |
defines | #define CSI2IPU_GASKET 0xf00 |
defines | #define CSI2IPU_YUV422_YUYV BIT(2) |
structs | struct csi2_dev {
struct device *dev;
struct v4l2_subdev sd;
struct media_pad pad[CSI2_NUM_PADS];
struct clk *dphy_clk;
struct clk *pllref_clk;
struct clk *pix_clk; /* what is this? */
void __iomem *base;
struct v4l2_fwnode_bus_mipi_csi2 bus;
/... |
functions | void csi2_enable(struct csi2_dev *csi2, bool enable)
{
if (enable) {
writel(0x1, csi2->base + CSI2_PHY_SHUTDOWNZ);
writel(0x1, csi2->base + CSI2_DPHY_RSTZ);
writel(0x1, csi2->base + CSI2_RESETN);
} |
functions | void csi2_set_lanes(struct csi2_dev *csi2)
{
int lanes = csi2->bus.num_data_lanes;
writel(lanes - 1, csi2->base + CSI2_N_LANES);
} |
functions | void dw_mipi_csi2_phy_write(struct csi2_dev *csi2,
u32 test_code, u32 test_data)
{
/* Clear PHY test interface */
writel(PHY_TESTCLR, csi2->base + CSI2_PHY_TST_CTRL0);
writel(0x0, csi2->base + CSI2_PHY_TST_CTRL1);
writel(0x0, csi2->base + CSI2_PHY_TST_CTRL0);
/* Raise test interface strobe signal */
write... |
functions | int max_mbps_to_hsfreqrange_sel(u32 max_mbps)
{
int i;
for (i = 0; i < ARRAY_SIZE(hsfreq_map); i++)
if (hsfreq_map[i].max_mbps > max_mbps)
return hsfreq_map[i].hsfreqrange_sel;
return -EINVAL;
} |
functions | int csi2_dphy_init(struct csi2_dev *csi2)
{
struct v4l2_ctrl *ctrl;
u32 mbps_per_lane;
int sel;
ctrl = v4l2_ctrl_find(csi2->src_sd->ctrl_handler,
V4L2_CID_LINK_FREQ);
if (!ctrl)
mbps_per_lane = CSI2_DEFAULT_MAX_MBPS;
else
mbps_per_lane = DIV_ROUND_UP_ULL(2 * ctrl->qmenu_int[ctrl->val],
USEC_P... |
functions | __maybe_unused csi2_dphy_wait_ulp(struct csi2_dev *csi2)
{
u32 reg;
int ret;
/* wait for ULP on clock lane */
ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
!(reg & PHY_RXULPSCLKNOT), 0, 500000);
if (ret) {
v4l2_err(&csi2->sd, "ULP timeout, phy_state = 0x%08x\n", reg);
return ret;
} |
functions | int csi2_dphy_wait_stopstate(struct csi2_dev *csi2)
{
u32 mask, reg;
int ret;
mask = PHY_STOPSTATECLK | (((1 << csi2->bus.num_data_lanes) - 1) <<
PHY_STOPSTATEDATA_BIT);
ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
(reg & mask) == mask, 0, 500000);
if (ret) {
v4l2_err(&csi2->sd, "LP-1... |
functions | int csi2_dphy_wait_clock_lane(struct csi2_dev *csi2)
{
u32 reg;
int ret;
ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
(reg & PHY_RXCLKACTIVEHS), 0, 500000);
if (ret) {
v4l2_err(&csi2->sd, "clock lane timeout, phy_state = 0x%08x\n",
reg);
return ret;
} |
functions | void csi2ipu_gasket_init(struct csi2_dev *csi2)
{
u32 reg = 0;
switch (csi2->format_mbus.code) {
case MEDIA_BUS_FMT_YUYV8_2X8:
case MEDIA_BUS_FMT_YUYV8_1X16:
reg = CSI2IPU_YUV422_YUYV;
break;
default:
break;
} |
functions | int csi2_start(struct csi2_dev *csi2)
{
int ret;
ret = clk_prepare_enable(csi2->pix_clk);
if (ret)
return ret;
/* setup the gasket */
csi2ipu_gasket_init(csi2);
/* Step 3 */
ret = csi2_dphy_init(csi2);
if (ret)
goto err_disable_clk;
/* Step 4 */
csi2_set_lanes(csi2);
csi2_enable(csi2, true);
/* Ste... |
functions | void csi2_stop(struct csi2_dev *csi2)
{
/* stop upstream */
v4l2_subdev_call(csi2->src_sd, video, s_stream, 0);
csi2_enable(csi2, false);
clk_disable_unprepare(csi2->pix_clk);
} |
functions | int csi2_s_stream(struct v4l2_subdev *sd, int enable)
{
struct csi2_dev *csi2 = sd_to_dev(sd);
int i, ret = 0;
mutex_lock(&csi2->lock);
if (!csi2->src_sd) {
ret = -EPIPE;
goto out;
} |
functions | int csi2_link_setup(struct media_entity *entity,
const struct media_pad *local,
const struct media_pad *remote, u32 flags)
{
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
struct csi2_dev *csi2 = sd_to_dev(sd);
struct v4l2_subdev *remote_sd;
int ret = 0;
dev_dbg(csi2->dev, "link setup %... |
functions | int csi2_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *sdformat)
{
struct csi2_dev *csi2 = sd_to_dev(sd);
struct v4l2_mbus_framefmt *fmt;
mutex_lock(&csi2->lock);
if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY)
fmt = v4l2_subdev_get_try_format(&csi2->sd, cfg... |
functions | int csi2_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *sdformat)
{
struct csi2_dev *csi2 = sd_to_dev(sd);
int ret = 0;
if (sdformat->pad >= CSI2_NUM_PADS)
return -EINVAL;
mutex_lock(&csi2->lock);
if (csi2->stream_count > 0) {
ret = -EBUSY;
goto out;
... |
functions | int csi2_registered(struct v4l2_subdev *sd)
{
struct csi2_dev *csi2 = sd_to_dev(sd);
int i, ret;
for (i = 0; i < CSI2_NUM_PADS; i++) {
csi2->pad[i].flags = (i == CSI2_SINK_PAD) ?
MEDIA_PAD_FL_SINK : MEDIA_PAD_FL_SOURCE;
} |
functions | int csi2_parse_endpoints(struct csi2_dev *csi2)
{
struct device_node *node = csi2->dev->of_node;
struct device_node *epnode;
struct v4l2_fwnode_endpoint ep;
epnode = of_graph_get_endpoint_by_regs(node, 0, -1);
if (!epnode) {
v4l2_err(&csi2->sd, "failed to get sink endpoint node\n");
return -EINVAL;
} |
functions | int csi2_probe(struct platform_device *pdev)
{
struct csi2_dev *csi2;
struct resource *res;
int ret;
csi2 = devm_kzalloc(&pdev->dev, sizeof(*csi2), GFP_KERNEL);
if (!csi2)
return -ENOMEM;
csi2->dev = &pdev->dev;
v4l2_subdev_init(&csi2->sd, &csi2_subdev_ops);
v4l2_set_subdevdata(&csi2->sd, &pdev->dev);
csi... |
functions | int csi2_remove(struct platform_device *pdev)
{
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csi2_dev *csi2 = sd_to_dev(sd);
v4l2_async_unregister_subdev(sd);
clk_disable_unprepare(csi2->dphy_clk);
clk_disable_unprepare(csi2->pllref_clk);
mutex_destroy(&csi2->lock);
media_entity_cleanup(&sd->enti... |
includes |
#include <linux/init.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/mutex.h> |
includes | #include <linux/module.h> |
includes | #include <linux/export.h> |
includes | #include <linux/pm.h> |
includes | #include <linux/pm_runtime.h> |
includes | #include <sound/core.h> |
includes | #include <sound/hda_codec.h> |
defines | #define is_likely_hdmi_codec(codec) false |
defines | #define is_generic_config(codec) \ |
defines | #define is_generic_config(codec) 0 |
functions | int hda_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
{
struct hda_codec *codec = container_of(dev, struct hda_codec, core);
struct hda_codec_driver *driver =
container_of(drv, struct hda_codec_driver, core);
const struct hda_device_id *list;
/* check probe_id instead of vendor_id if set */
u32 i... |
functions | void hda_codec_unsol_event(struct hdac_device *dev, unsigned int ev)
{
struct hda_codec *codec = container_of(dev, struct hda_codec, core);
/* ignore unsol events during shutdown */
if (codec->bus->shutdown)
return;
/* ignore unsol events during system suspend/resume */
if (codec->core.dev.power.power_state.ev... |
functions | int snd_hda_codec_set_name(struct hda_codec *codec, const char *name)
{
int err;
if (!name)
return 0;
err = snd_hdac_device_set_chip_name(&codec->core, name);
if (err < 0)
return err;
/* update the mixer name */
if (!*codec->card->mixername ||
codec->bus->mixer_assigned >= codec->core.addr) {
snprint... |
functions | int hda_codec_driver_probe(struct device *dev)
{
struct hda_codec *codec = dev_to_hda_codec(dev);
struct module *owner = dev->driver->owner;
hda_codec_patch_t patch;
int err;
if (codec->bus->core.ext_ops) {
if (WARN_ON(!codec->bus->core.ext_ops->hdev_attach))
return -EINVAL;
return codec->bus->core.ext_ops... |
functions | int hda_codec_driver_remove(struct device *dev)
{
struct hda_codec *codec = dev_to_hda_codec(dev);
if (codec->bus->core.ext_ops) {
if (WARN_ON(!codec->bus->core.ext_ops->hdev_detach))
return -EINVAL;
return codec->bus->core.ext_ops->hdev_detach(&codec->core);
} |
functions | void hda_codec_driver_shutdown(struct device *dev)
{
snd_hda_codec_shutdown(dev_to_hda_codec(dev));
} |
functions | int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
struct module *owner)
{
drv->core.driver.name = name;
drv->core.driver.owner = owner;
drv->core.driver.bus = &snd_hda_bus_type;
drv->core.driver.probe = hda_codec_driver_probe;
drv->core.driver.remove = hda_codec_driver_remov... |
functions | void hda_codec_driver_unregister(struct hda_codec_driver *drv)
{
driver_unregister(&drv->core.driver);
} |
functions | bool codec_probed(struct hda_codec *codec)
{
return device_attach(hda_codec_dev(codec)) > 0 && codec->preset;
} |
functions | void request_codec_module(struct hda_codec *codec)
{
#ifdef MODULE
char modalias[32];
const char *mod = NULL;
switch (codec->probe_id) {
case HDA_CODEC_ID_GENERIC_HDMI:
#if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI)
mod = "snd-hda-codec-hdmi";
#endif
break;
case HDA_CODEC_ID_GENERIC:
#if IS_MODULE(CONFIG_SND_HDA_GE... |
functions | void codec_bind_module(struct hda_codec *codec)
{
#ifdef MODULE
request_codec_module(codec);
if (codec_probed(codec))
return;
#endif
} |
functions | bool is_likely_hdmi_codec(struct hda_codec *codec)
{
hda_nid_t nid;
for_each_hda_codec_node(nid, codec) {
unsigned int wcaps = get_wcaps(codec, nid);
switch (get_wcaps_type(wcaps)) {
case AC_WID_AUD_IN:
return false; /* HDMI parser supports only HDMI out */
case AC_WID_AUD_OUT:
if (!(wcaps & AC_WCAP_DI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.