linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Akihiro TSUKADA <tskd08@gmail.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org, Matthias Schwarzott <zzam@gentoo.org>
Subject: Re: [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator
Date: Sun, 07 Sep 2014 04:05:18 +0300	[thread overview]
Message-ID: <540BAF4E.5080504@iki.fi> (raw)
In-Reply-To: <540B61EE.8080708@gmail.com>



On 09/06/2014 10:35 PM, Akihiro TSUKADA wrote:
> moikka!,
>
>> Basically it is 2 functions, af9035_add_i2c_dev() and af9035_del_i2c_dev()
>
> I used request_module()/try_module_get()/module_put()
> just like the above example (and bridge-core.c).
> It works, but when I unload bridge driver(earth_pt3),
> its demod and tuner modules stay loaded, with the refcount of 0.
> Is it ok that the auto loaded modules remain with 0 ref count?

So there is no other problem than those modules were left loaded? If you 
could unload those using rmmod it is OK then. Ref counting is here to 
prevent unloading demod and tuner driver while those are used by some 
other module. So when bridge is loaded, you should not be able to unload 
demod or tuner. But when bridge is unloaded, you should be able to 
unload demod and tuner.

And your question, I think there is no way to unload modules 
automatically or at least no need.

>> Yet, using config to OUT seems to be bit hacky for my eyes too. I though
>> replacing all OUT with ops when converted af9033 driver. Currently
>> caller fills struct af9033_ops and then af9033 I2C probe populates ops.
>> See that patch:
>> https://patchwork.linuxtv.org/patch/25746/
>>
>> Does this kind of ops sounds any better?
>
> Do you mean using ops in struct config?
> if so, I don't find much difference with the current situation
> where demod/tuner probe() sets dvb_frontend* to config->fe.

Alloc driver specific ops in bridge driver, then put pointer to that ops 
to config struct. Driver fills ops during probe. Maybe that patch clears 
the idea:
af9033: Don't export functions for the hardware filter
https://patchwork.linuxtv.org/patch/23087/

Functionality is not much different than passing pointer to frontend 
pointer from bridge to I2C demod driver via platform_data...

Somehow you will need to transfer data during driver loading and there 
is not many alternatives:
* platform data pointer
* driver data pointer
* export function
* i2c_clients_command (legacy)
* device ID string (not very suitable)
* + the rest from i2c client, not related at all

regards
Antti

-- 
http://palosaari.fi/

  reply	other threads:[~2014-09-07  1:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 15:29 [PATCH v2 0/5] dvb: Add support for PT3 ISDB-S/T card tskd08
2014-08-27 15:29 ` [PATCH v2 1/5] dvb-core: add a new tuner ops to dvb_frontend for APIv5 tskd08
2014-08-27 18:09   ` Antti Palosaari
2014-08-28  9:07     ` Akihiro TSUKADA
2014-08-29  1:05       ` Antti Palosaari
2014-08-29 10:45         ` Akihiro TSUKADA
2014-09-06  2:09           ` Antti Palosaari
2014-09-06  2:51             ` Mauro Carvalho Chehab
2014-09-06  2:54               ` Mauro Carvalho Chehab
2014-09-06  3:10                 ` Antti Palosaari
2014-09-06  3:17                   ` Mauro Carvalho Chehab
2014-09-06  3:34                     ` Antti Palosaari
2014-09-06 12:35                       ` Mauro Carvalho Chehab
2014-09-06  4:08                     ` Akihiro TSUKADA
2014-09-06 10:36                       ` Antti Palosaari
2014-09-06 12:49                         ` Mauro Carvalho Chehab
2014-09-06 16:24               ` Malcolm Priestley
2014-09-06 16:31                 ` Malcolm Priestley
2014-09-06 21:37                 ` Malcolm Priestley
2014-09-06 22:37                   ` Mauro Carvalho Chehab
2014-09-06 23:38                     ` Antti Palosaari
2014-09-07  9:35                       ` Malcolm Priestley
2014-08-27 15:29 ` [PATCH v2 2/5] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner tskd08
2014-08-27 15:29 ` [PATCH v2 3/5] qm1d1c0042: add driver for Sharp QM1D1C0042 ISDB-S tuner tskd08
2014-08-27 15:29 ` [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator tskd08
2014-08-31 10:29   ` Matthias Schwarzott
2014-08-31 13:32     ` Akihiro TSUKADA
2014-08-31 19:48       ` Antti Palosaari
2014-09-01  9:54         ` Akihiro TSUKADA
2014-09-06  2:02           ` Antti Palosaari
2014-09-06  2:27             ` Mauro Carvalho Chehab
2014-09-06  3:00               ` DVB clock source (Re: [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator) Antti Palosaari
2014-09-06  3:11                 ` Mauro Carvalho Chehab
2014-09-06  3:20                   ` Antti Palosaari
2014-09-06  6:09               ` [PATCH v2 4/5] tc90522: add driver for Toshiba TC90522 quad demodulator Akihiro TSUKADA
2014-09-06  6:51                 ` Antti Palosaari
2014-09-06 19:35                   ` Akihiro TSUKADA
2014-09-07  1:05                     ` Antti Palosaari [this message]
2014-09-06  7:13                 ` Antti Palosaari
2014-08-27 15:29 ` [PATCH v2 5/5] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card tskd08

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540BAF4E.5080504@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=tskd08@gmail.com \
    --cc=zzam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).