1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2025, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define pr_fmt(fmt) "tlmm-test: " fmt
#include <kunit/test.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
/*
* This TLMM test module serves the purpose of validating that the TLMM driver
* (pinctrl-msm) delivers expected number of interrupts in response to changing
* GPIO state.
*
* To achieve this without external equipment the test takes a module parameter
* "gpio", which the tester is expected to specify an unused and non-connected
* pin. The GPIO state is then driven by adjusting the bias of the pin, at
* suitable times through the different test cases.
*
* Upon execution, the test initialization will find the TLMM node (subject to
* tlmm_of_match[] allow listing) and create the necessary references
* dynamically, rather then relying on e.g. Devicetree and phandles.
*/
#define MSM_PULL_MASK GENMASK(2, 0)
#define MSM_PULL_DOWN 1
#define MSM_PULL_UP 3
#define TLMM_REG_SIZE 0x1000
static int tlmm_test_gpio = -1;
static char *tlmm_reg_name = "default_region";
module_param_named(gpio, tlmm_test_gpio, int, 0600);
module_param_named(name, tlmm_reg_name, charp, 0600);
static struct {
void __iomem *base;
void __iomem *reg;
int irq;
u32 low_val;
u32 high_val;
} tlmm_suite;
/**
* struct tlmm_test_priv - Per-test context
* @intr_count: number of times hard handler was hit with TLMM_TEST_COUNT op set
* @thread_count: number of times thread handler was hit with TLMM_TEST_COUNT op set
* @intr_op: operations to be performed by the hard IRQ handler
* @intr_op_remain: number of times the TLMM_TEST_THEN_* operations should be
* performed by the hard IRQ handler
* @thread_op: operations to be performed by the threaded IRQ handler
* @thread_op_remain: number of times the TLMM_TEST_THEN_* operations should
* be performed by the threaded IRQ handler
*/
struct tlmm_test_priv {
atomic_t intr_count;
atomic_t thread_count;
unsigned int intr_op;
atomic_t intr_op_remain;
unsigned int thread_op;
atomic_t thread_op_remain;
};
/* Operation masks for @intr_op and @thread_op */
#define TLMM_TEST_COUNT BIT(0)
#define TLMM_TEST_OUTPUT_LOW BIT(1)
#define TLMM_TEST_OUTPUT_HIGH BIT(2)
#define TLMM_TEST_THEN_HIGH BIT(3)
#define TLMM_TEST_THEN_LOW BIT(4)
#define TLMM_TEST_WAKE_THREAD BIT(5)
static void tlmm_output_low(void)
{
writel(tlmm_suite.low_val, tlmm_suite.reg);
readl(tlmm_suite.reg);
}
static void tlmm_output_high(void)
{
writel(tlmm_suite.high_val, tlmm_suite.reg);
readl(tlmm_suite.reg);
}
static irqreturn_t tlmm_test_intr_fn(int irq, void *dev_id)
{
struct tlmm_test_priv *priv = dev_id;
if (priv->intr_op & TLMM_TEST_COUNT)
atomic_inc(&priv->intr_count);
if (priv->intr_op & TLMM_TEST_OUTPUT_LOW)
tlmm_output_low();
if (priv->intr_op & TLMM_TEST_OUTPUT_HIGH)
tlmm_output_high();
if (atomic_dec_if_positive(&priv->intr_op_remain) > 0) {
udelay(1);
if (priv->intr_op & TLMM_TEST_THEN_LOW)
tlmm_output_low();
if (priv->intr_op & TLMM_TEST_THEN_HIGH)
tlmm_output_high();
}
return priv->intr_op & TLMM_TEST_WAKE_THREAD ? IRQ_WAKE_THREAD : IRQ_HANDLED;
}
static irqreturn_t tlmm_test_intr_thread_fn(int irq, void *dev_id)
{
struct tlmm_test_priv *priv = dev_id;
if (priv->thread_op & TLMM_TEST_COUNT)
atomic_inc(&priv->thread_count);
if (priv->thread_op & TLMM_TEST_OUTPUT_LOW)
tlmm_output_low();
if (priv->thread_op & TLMM_TEST_OUTPUT_HIGH)
tlmm_output_high();
if (atomic_dec_if_positive(&priv->thread_op_remain) > 0) {
udelay(1);
if (priv->thread_op & TLMM_TEST_THEN_LOW)
tlmm_output_low();
if (priv->thread_op & TLMM_TEST_THEN_HIGH)
tlmm_output_high();
}
return IRQ_HANDLED;
}
static void tlmm_test_request_hard_irq(struct kunit *test, unsigned long irqflags)
{
struct tlmm_test_priv *priv = test->priv;
int ret;
ret = request_irq(tlmm_suite.irq, tlmm_test_intr_fn, irqflags, test->name, priv);
KUNIT_EXPECT_EQ(test, ret, 0);
}
static void tlmm_test_request_threaded_irq(struct kunit *test, unsigned long irqflags)
{
struct tlmm_test_priv *priv = test->priv;
int ret;
ret = request_threaded_irq(tlmm_suite.irq,
tlmm_test_intr_fn, tlmm_test_intr_thread_fn,
irqflags, test->name, priv);
KUNIT_EXPECT_EQ(test, ret, 0);
}
static void tlmm_test_silent(struct kunit *test, unsigned long irqflags)
{
struct tlmm_test_priv *priv = test->priv;
priv->intr_op = TLMM_TEST_COUNT;
/* GPIO line at non-triggering level */
if (irqflags == IRQF_TRIGGER_LOW || irqflags == IRQF_TRIGGER_FALLING)
tlmm_output_high();
else
tlmm_output_low();
tlmm_test_request_hard_irq(test, irqflags);
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 0);
}
/*
* Test that no RISING interrupts are triggered on a silent pin
*/
static void tlmm_test_silent_rising(struct kunit *test)
{
tlmm_test_silent(test, IRQF_TRIGGER_RISING);
}
/*
* Test that no FALLING interrupts are triggered on a silent pin
*/
static void tlmm_test_silent_falling(struct kunit *test)
{
tlmm_test_silent(test, IRQF_TRIGGER_FALLING);
}
/*
* Test that no LOW interrupts are triggered on a silent pin
*/
static void tlmm_test_silent_low(struct kunit *test)
{
tlmm_test_silent(test, IRQF_TRIGGER_LOW);
}
/*
* Test that no HIGH interrupts are triggered on a silent pin
*/
static void tlmm_test_silent_high(struct kunit *test)
{
tlmm_test_silent(test, IRQF_TRIGGER_HIGH);
}
/*
* Square wave with 10 high pulses, assert that we get 10 rising interrupts
*/
static void tlmm_test_rising(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT;
tlmm_output_low();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_RISING);
for (i = 0; i < 10; i++) {
tlmm_output_low();
msleep(20);
tlmm_output_high();
msleep(20);
}
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
}
/*
* Square wave with 10 low pulses, assert that we get 10 falling interrupts
*/
static void tlmm_test_falling(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT;
tlmm_output_high();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_FALLING);
for (i = 0; i < 10; i++) {
tlmm_output_high();
msleep(20);
tlmm_output_low();
msleep(20);
}
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
}
/*
* Drive line low 10 times, handler drives it high to "clear the interrupt
* source", assert we get 10 interrupts
*/
static void tlmm_test_low(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_HIGH;
atomic_set(&priv->intr_op_remain, 9);
tlmm_output_high();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_LOW);
for (i = 0; i < 10; i++) {
msleep(20);
tlmm_output_low();
}
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
}
/*
* Drive line high 10 times, handler drives it low to "clear the interrupt
* source", assert we get 10 interrupts
*/
static void tlmm_test_high(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_LOW;
atomic_set(&priv->intr_op_remain, 9);
tlmm_output_low();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_HIGH);
for (i = 0; i < 10; i++) {
msleep(20);
tlmm_output_high();
}
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
}
/*
* Handler drives GPIO high to "clear the interrupt source", then low to
* simulate a new interrupt, repeated 10 times, assert we get 10 interrupts
*/
static void tlmm_test_falling_in_handler(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_HIGH | TLMM_TEST_THEN_LOW;
atomic_set(&priv->intr_op_remain, 10);
tlmm_output_high();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_FALLING);
msleep(20);
tlmm_output_low();
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
}
/*
* Handler drives GPIO low to "clear the interrupt source", then high to
* simulate a new interrupt, repeated 10 times, assert we get 10 interrupts
*/
static void tlmm_test_rising_in_handler(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_LOW | TLMM_TEST_THEN_HIGH;
atomic_set(&priv->intr_op_remain, 10);
tlmm_output_low();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_RISING);
msleep(20);
tlmm_output_high();
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
}
/*
* Square wave with 10 high pulses, assert that we get 10 rising hard and
* 10 threaded interrupts
*/
static void tlmm_test_thread_rising(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_WAKE_THREAD;
priv->thread_op = TLMM_TEST_COUNT;
tlmm_output_low();
tlmm_test_request_threaded_irq(test, IRQF_TRIGGER_RISING);
for (i = 0; i < 10; i++) {
tlmm_output_low();
msleep(20);
tlmm_output_high();
msleep(20);
}
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->thread_count), 10);
}
/*
* Square wave with 10 low pulses, assert that we get 10 falling interrupts
*/
static void tlmm_test_thread_falling(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_WAKE_THREAD;
priv->thread_op = TLMM_TEST_COUNT;
tlmm_output_high();
tlmm_test_request_threaded_irq(test, IRQF_TRIGGER_FALLING);
for (i = 0; i < 10; i++) {
tlmm_output_high();
msleep(20);
tlmm_output_low();
msleep(20);
}
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->thread_count), 10);
}
/*
* Drive line high 10 times, threaded handler drives it low to "clear the
* interrupt source", assert we get 10 interrupts
*/
static void tlmm_test_thread_high(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_WAKE_THREAD;
priv->thread_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_LOW;
tlmm_output_low();
tlmm_test_request_threaded_irq(test, IRQF_TRIGGER_HIGH | IRQF_ONESHOT);
for (i = 0; i < 10; i++) {
tlmm_output_high();
msleep(20);
}
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->thread_count), 10);
}
/*
* Drive line low 10 times, threaded handler drives it high to "clear the
* interrupt source", assert we get 10 interrupts
*/
static void tlmm_test_thread_low(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
int i;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_WAKE_THREAD;
priv->thread_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_HIGH;
tlmm_output_high();
tlmm_test_request_threaded_irq(test, IRQF_TRIGGER_LOW | IRQF_ONESHOT);
for (i = 0; i < 10; i++) {
tlmm_output_low();
msleep(20);
}
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->thread_count), 10);
}
/*
* Handler drives GPIO low to "clear the interrupt source", then high in the
* threaded handler to simulate a new interrupt, repeated 10 times, assert we
* get 10 interrupts
*/
static void tlmm_test_thread_rising_in_handler(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_LOW | TLMM_TEST_WAKE_THREAD;
priv->thread_op = TLMM_TEST_COUNT | TLMM_TEST_THEN_HIGH;
atomic_set(&priv->thread_op_remain, 10);
tlmm_output_low();
tlmm_test_request_threaded_irq(test, IRQF_TRIGGER_RISING);
msleep(20);
tlmm_output_high();
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->thread_count), 10);
}
/*
* Handler drives GPIO high to "clear the interrupt source", then low in the
* threaded handler to simulate a new interrupt, repeated 10 times, assert we
* get 10 interrupts
*/
static void tlmm_test_thread_falling_in_handler(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
priv->intr_op = TLMM_TEST_COUNT | TLMM_TEST_OUTPUT_HIGH | TLMM_TEST_WAKE_THREAD;
priv->thread_op = TLMM_TEST_COUNT | TLMM_TEST_THEN_LOW;
atomic_set(&priv->thread_op_remain, 10);
tlmm_output_high();
tlmm_test_request_threaded_irq(test, IRQF_TRIGGER_FALLING);
msleep(20);
tlmm_output_low();
msleep(100);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 10);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->thread_count), 10);
}
/*
* Validate that edge interrupts occurring while irq is disabled is delivered
* once the interrupt is reenabled.
*/
static void tlmm_test_rising_while_disabled(struct kunit *test)
{
struct tlmm_test_priv *priv = test->priv;
unsigned int after_edge;
unsigned int before_edge;
priv->intr_op = TLMM_TEST_COUNT;
atomic_set(&priv->thread_op_remain, 10);
tlmm_output_low();
tlmm_test_request_hard_irq(test, IRQF_TRIGGER_RISING);
msleep(20);
disable_irq(tlmm_suite.irq);
before_edge = atomic_read(&priv->intr_count);
tlmm_output_high();
msleep(20);
after_edge = atomic_read(&priv->intr_count);
msleep(20);
enable_irq(tlmm_suite.irq);
msleep(20);
free_irq(tlmm_suite.irq, priv);
KUNIT_ASSERT_EQ(test, before_edge, 0);
KUNIT_ASSERT_EQ(test, after_edge, 0);
KUNIT_ASSERT_EQ(test, atomic_read(&priv->intr_count), 1);
}
static int tlmm_test_init(struct kunit *test)
{
struct tlmm_test_priv *priv;
priv = kunit_kzalloc(test, sizeof(*priv), GFP_KERNEL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv);
atomic_set(&priv->intr_count, 0);
atomic_set(&priv->thread_count, 0);
atomic_set(&priv->intr_op_remain, 0);
atomic_set(&priv->thread_op_remain, 0);
test->priv = priv;
return 0;
}
/*
* NOTE: When adding compatibles to this list, ensure that TLMM_REG_SIZE and
* pull configuration values are supported and correct.
*/
static const struct of_device_id tlmm_of_match[] = {
{ .compatible = "qcom,sc8280xp-tlmm" },
{ .compatible = "qcom,x1e80100-tlmm" },
{}
};
static int tlmm_reg_base(struct device_node *tlmm, struct resource *res)
{
const char **reg_names;
int count;
int ret;
int i;
count = of_property_count_strings(tlmm, "reg-names");
if (count <= 0) {
pr_err("failed to find tlmm reg name\n");
return count;
}
reg_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
if (!reg_names)
return -ENOMEM;
ret = of_property_read_string_array(tlmm, "reg-names", reg_names, count);
if (ret != count) {
kfree(reg_names);
return -EINVAL;
}
if (!strcmp(tlmm_reg_name, "default_region")) {
ret = of_address_to_resource(tlmm, 0, res);
} else {
for (i = 0; i < count; i++) {
if (!strcmp(reg_names[i], tlmm_reg_name)) {
ret = of_address_to_resource(tlmm, i, res);
break;
}
}
if (i == count)
ret = -EINVAL;
}
kfree(reg_names);
return ret;
}
static int tlmm_test_init_suite(struct kunit_suite *suite)
{
struct of_phandle_args args = {};
struct resource res;
int ret;
u32 val;
if (tlmm_test_gpio < 0) {
pr_err("use the tlmm-test.gpio module parameter to specify which GPIO to use\n");
return -EINVAL;
}
struct device_node *tlmm __free(device_node) = of_find_matching_node(NULL, tlmm_of_match);
if (!tlmm) {
pr_err("failed to find tlmm node\n");
return -EINVAL;
}
ret = tlmm_reg_base(tlmm, &res);
if (ret < 0)
return ret;
tlmm_suite.base = ioremap(res.start, resource_size(&res));
if (!tlmm_suite.base)
return -ENOMEM;
args.np = tlmm;
args.args_count = 2;
args.args[0] = tlmm_test_gpio;
args.args[1] = 0;
tlmm_suite.irq = irq_create_of_mapping(&args);
if (!tlmm_suite.irq) {
pr_err("failed to map TLMM irq %d\n", args.args[0]);
goto err_unmap;
}
tlmm_suite.reg = tlmm_suite.base + tlmm_test_gpio * TLMM_REG_SIZE;
val = readl(tlmm_suite.reg) & ~MSM_PULL_MASK;
tlmm_suite.low_val = val | MSM_PULL_DOWN;
tlmm_suite.high_val = val | MSM_PULL_UP;
return 0;
err_unmap:
iounmap(tlmm_suite.base);
tlmm_suite.base = NULL;
return -EINVAL;
}
static void tlmm_test_exit_suite(struct kunit_suite *suite)
{
irq_dispose_mapping(tlmm_suite.irq);
iounmap(tlmm_suite.base);
tlmm_suite.base = NULL;
tlmm_suite.irq = -1;
}
static struct kunit_case tlmm_test_cases[] = {
KUNIT_CASE(tlmm_test_silent_rising),
KUNIT_CASE(tlmm_test_silent_falling),
KUNIT_CASE(tlmm_test_silent_low),
KUNIT_CASE(tlmm_test_silent_high),
KUNIT_CASE(tlmm_test_rising),
KUNIT_CASE(tlmm_test_falling),
KUNIT_CASE(tlmm_test_high),
KUNIT_CASE(tlmm_test_low),
KUNIT_CASE(tlmm_test_rising_in_handler),
KUNIT_CASE(tlmm_test_falling_in_handler),
KUNIT_CASE(tlmm_test_thread_rising),
KUNIT_CASE(tlmm_test_thread_falling),
KUNIT_CASE(tlmm_test_thread_high),
KUNIT_CASE(tlmm_test_thread_low),
KUNIT_CASE(tlmm_test_thread_rising_in_handler),
KUNIT_CASE(tlmm_test_thread_falling_in_handler),
KUNIT_CASE(tlmm_test_rising_while_disabled),
{}
};
static struct kunit_suite tlmm_test_suite = {
.name = "tlmm-test",
.init = tlmm_test_init,
.suite_init = tlmm_test_init_suite,
.suite_exit = tlmm_test_exit_suite,
.test_cases = tlmm_test_cases,
};
kunit_test_suites(&tlmm_test_suite);
MODULE_DESCRIPTION("Qualcomm TLMM test");
MODULE_LICENSE("GPL");
|