int as102_dvb_register(struct as102_dev_t *as102_dev) { int ret = 0; ENTER(); dprintk(debug,"1 dvb_register_adapter\n"); ret = dvb_register_adapter(&as102_dev->dvb_adap, as102_dev->name, THIS_MODULE, &as102_dev->bus_adap.usb_dev->dev, adapter_nr ); if (ret < 0) { err("%s: dvb_register_adapter() failed (errno = %d)", __func__, ret); goto failed; } /*j00zek comment: We don't initiate demux here as we use one from player2*/ #if 0 as102_dev->dvb_dmx.priv = as102_dev; as102_dev->dvb_dmx.filternum = pid_filtering ? 16 : 256; as102_dev->dvb_dmx.feednum = 256; as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed; as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed; as102_dev->dvb_dmx.write_to_decoder = NULL; as102_dev->dvb_dmx.dmx.set_source = NULL; //as102_dvb_dmx_SetSource; as102_dev->dvb_dmx.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING; as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum; as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx; as102_dev->dvb_dmxdev.capabilities = 0; dprintk(debug,"3 dvb_dmx_init\n"); ret = dvb_dmx_init(&as102_dev->dvb_dmx); if (ret < 0) { err("%s: dvb_dmx_init() failed (errno = %d)", __func__, ret); goto failed; } dprintk(debug,"4 dvb_dmxdev_init\n"); ret = dvb_dmxdev_init(&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap); if (ret < 0) { err("%s: dvb_dmxdev_init() failed (errno = %d)", __func__, ret); goto failed; } #endif dprintk(debug,"2 dvb_register_frontend\n"); ret = as102_dvb_register_fe(as102_dev, &as102_dev->dvb_fe); if (ret < 0) { err("%s: as102_dvb_register_frontend() failed (errno = %d)", __func__, ret); goto failed; } /* init bus mutex for token locking */ mutex_init(&as102_dev->bus_adap.lock); /* init start / stop stream mutex */ mutex_init(&as102_dev->sem); #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) /* * try to load as102 firmware. If firmware upload failed, we'll be * able to upload it later. */ if (fw_upload) try_then_request_module(as102_fw_upload(&as102_dev->bus_adap), "firmware_class"); #endif /* start/stop pid from dvb_demux.c */ as102_dev_ = as102_dev;//store dvb_adapter to use later when feeding from demux_player2 extern_startfeed_init(as102_dvb_dmx_start_feed,as102_dvb_dmx_stop_feed); failed: LEAVE(); /* FIXME: free dvb_XXX */ return ret; }
int as102_dvb_register(struct as102_dev_t *as102_dev) { struct device *dev = &as102_dev->bus_adap.usb_dev->dev; int ret; ret = dvb_register_adapter(&as102_dev->dvb_adap, as102_dev->name, THIS_MODULE, dev, adapter_nr); if (ret < 0) { dev_err(dev, "%s: dvb_register_adapter() failed: %d\n", __func__, ret); return ret; } as102_dev->dvb_dmx.priv = as102_dev; as102_dev->dvb_dmx.filternum = pid_filtering ? 16 : 256; as102_dev->dvb_dmx.feednum = 256; as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed; as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed; as102_dev->dvb_dmx.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum; as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx; as102_dev->dvb_dmxdev.capabilities = 0; ret = dvb_dmx_init(&as102_dev->dvb_dmx); if (ret < 0) { dev_err(dev, "%s: dvb_dmx_init() failed: %d\n", __func__, ret); goto edmxinit; } ret = dvb_dmxdev_init(&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap); if (ret < 0) { dev_err(dev, "%s: dvb_dmxdev_init() failed: %d\n", __func__, ret); goto edmxdinit; } ret = as102_dvb_register_fe(as102_dev, &as102_dev->dvb_fe); if (ret < 0) { dev_err(dev, "%s: as102_dvb_register_frontend() failed: %d", __func__, ret); goto efereg; } /* init bus mutex for token locking */ mutex_init(&as102_dev->bus_adap.lock); /* init start / stop stream mutex */ mutex_init(&as102_dev->sem); /* * try to load as102 firmware. If firmware upload failed, we'll be * able to upload it later. */ if (fw_upload) try_then_request_module(as102_fw_upload(&as102_dev->bus_adap), "firmware_class"); pr_info("Registered device %s", as102_dev->name); return 0; efereg: dvb_dmxdev_release(&as102_dev->dvb_dmxdev); edmxdinit: dvb_dmx_release(&as102_dev->dvb_dmx); edmxinit: dvb_unregister_adapter(&as102_dev->dvb_adap); return ret; }
int as102_dvb_register(struct as102_dev_t *as102_dev) { int ret = 0; ENTER(); #if defined(CONFIG_DVB_CORE) || defined(CONFIG_DVB_CORE_MODULE) ret = dvb_register_adapter(&as102_dev->dvb_adap, as102_dev->name, THIS_MODULE, #if defined(CONFIG_AS102_USB) &as102_dev->bus_adap.usb_dev->dev #elif defined(CONFIG_AS102_SPI) &as102_dev->bus_adap.spi_dev->dev #else #error >>> dvb_register_adapter <<< #endif #ifdef DVB_DEFINE_MOD_OPT_ADAPTER_NR , adapter_nr #endif ); if (ret < 0) { err("%s: dvb_register_adapter() failed (errno = %d)", __func__, ret); goto failed; } as102_dev->dvb_dmx.priv = as102_dev; as102_dev->dvb_dmx.filternum = pid_filtering ? 16 : 256; as102_dev->dvb_dmx.feednum = 256; as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed; as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed; as102_dev->dvb_dmx.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum; as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx; as102_dev->dvb_dmxdev.capabilities = 0; ret = dvb_dmx_init(&as102_dev->dvb_dmx); if (ret < 0) { err("%s: dvb_dmx_init() failed (errno = %d)", __func__, ret); goto failed; } ret = dvb_dmxdev_init(&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap); if (ret < 0) { err("%s: dvb_dmxdev_init() failed (errno = %d)", __func__, ret); goto failed; } ret = as102_dvb_register_fe(as102_dev, &as102_dev->dvb_fe); if (ret < 0) { err("%s: as102_dvb_register_frontend() failed (errno = %d)", __func__, ret); goto failed; } #endif /* init bus mutex for token locking */ mutex_init(&as102_dev->bus_adap.lock); /* init start / stop stream mutex */ mutex_init(&as102_dev->sem); #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) /* * try to load as102 firmware. If firmware upload failed, we'll be * able to upload it later. */ if (fw_upload) try_then_request_module(as102_fw_upload(&as102_dev->bus_adap), "firmware_class"); #endif failed: LEAVE(); /* FIXME: free dvb_XXX */ return ret; }