Hi Graeme, But FDT driver has import those info into platform device, and my driver is using module_platform_driver(sbsa_gwdt_driver). and it probe device from platform.
any reason we still need MODULE_DEVICE_TABLE(of, sbsa_gwdt_of_match); for booting with dtb? Do I miss something again? :-)
Great thanks
On 18 May 2015 at 18:39, G Gregory graeme.gregory@linaro.org wrote:
Fu Wei,
You will need it if you want DT matching to work from the FDT.
Graeme
On 18 May 2015 at 11:33, Fu Wei fu.wei@linaro.org wrote:
Hi Greame,
Do we need
static const struct of_device_id sbsa_gwdt_of_match[] = { { .compatible = "arm,sbsa-gwdt", }, {}, }; MODULE_DEVICE_TABLE(of, sbsa_gwdt_of_match);
any more?
I guess we can just use " MODULE_DEVICE_TABLE(platform, sbsa_gwdt_id);"
On 18 May 2015 at 18:26, G Gregory graeme.gregory@linaro.org wrote:
struct platform_device_id sbsa_gwdt_id { {"sbsa-gwdt", }, };
MODULE_DEVICE_TABLE(platform, sbsa_gwdt_id);
or something like that from memory.
Graeme
On 18 May 2015 at 11:11, Fu Wei fu.wei@linaro.org wrote:
Hi Graeme,
Are you saying :
static struct platform_driver sbsa_gwdt_driver = { .driver = { .name = "sbsa-gwdt", .pm = &sbsa_gwdt_pm_ops, .of_match_table = sbsa_gwdt_of_match, }, .probe = sbsa_gwdt_probe, .remove = sbsa_gwdt_remove, .shutdown = sbsa_gwdt_shutdown, };
.name = "sbsa-gwdt", ???
I am not sure if that can do the auto-insmod part, maybe I miss some knowledge of platform_driver , But AFAIK, the platform mechanism uses that name to match the driver and device, ONCE the driver or device is registered into system. that means when the driver is insmod'ed , then the "name" will take effect.
But MODULE_DEVICE_TABLE creates an alias string in the .ok so depmod can find device table.
please correct me , If I misunderstand this part .
On 18 May 2015 at 17:11, Hanjun Guo hanjun.guo@linaro.org wrote:
On 2015年05月18日 17:05, G Gregory wrote:
Shouldn't the standard platform_device matching kick in?
It should match the driver to the name!
Hmm, I missed this part, I'm not familiar with the mechanism, Fuwei, could you please try this direction?
Graeme
On 18 May 2015 at 10:04, Hanjun Guo hanjun.guo@linaro.org wrote: > > On 2015年05月18日 16:48, Fu Wei wrote: >> >> >> Hi Suravee, >> >> Hanjun and me have figured out the problem of auto-insmod SBSA >> watchdog module, when boot with ACPI: >> >> For now , we can not insmod SBSA watchdog driver automatically, because >> : >> >> For booting with dtb , in the driver module, we already have : >> --------------------- >> static const struct of_device_id sbsa_gwdt_of_match[] = { >> { .compatible = "arm,sbsa-gwdt", }, >> {}, >> }; >> MODULE_DEVICE_TABLE(of, sbsa_gwdt_of_match); >> --------------------- >> >> For booting with acpi , we should have sometime like : >> --------------------- >> static const struct acpi_device_id sbsa_gwdt_ids[] __used = { >> {ACPI_GTDT_SBSA_GWDT_HID, 0}, >> {"", 0} >> }; >> MODULE_DEVICE_TABLE(acpi, sbsa_gwdt_ids); >> --------------------- >> >> Unfortunately, for now , in ACPI spec, it seems we don't have >> ACPI_GTDT_SBSA_GWDT_HID, and in Linux kernel, there is not a >> mechanism to register the Wakeup-timer and Watchdog in GTDT with >> ACPI_GTDT_*_HID. >> >> Maybe, ACPI team of LEG can discuss about that and rise a request of >> adding ACPI_GTDT_*_HID to ACPI spec for GTDT table >> >> @Hanjun, Al >> Please correct me if I misunderstand something :-) >> Great thanks! > > > > You are right, more specifically, there is no mechanism to auto > match/register modules for ACPI static tables (MADT/gtdt..), I think > we can post a question on ACPI maillist to see if any good inputs. > > Thanks > Hanjun
-- Best regards,
Fu Wei Software Engineer Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch Ph: +86 21 61221326(direct) Ph: +86 186 2020 4684 (mobile) Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021
-- Best regards,
Fu Wei Software Engineer Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch Ph: +86 21 61221326(direct) Ph: +86 186 2020 4684 (mobile) Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021