|
92 | 92 | #define TCAN4X5X_MODE_STANDBY BIT(6)
|
93 | 93 | #define TCAN4X5X_MODE_NORMAL BIT(7)
|
94 | 94 |
|
| 95 | +#define TCAN4X5X_NWKRQ_VOLTAGE_VIO BIT(19) |
| 96 | + |
95 | 97 | #define TCAN4X5X_DISABLE_WAKE_MSK (BIT(31) | BIT(30))
|
96 | 98 | #define TCAN4X5X_DISABLE_INH_MSK BIT(9)
|
97 | 99 |
|
@@ -267,6 +269,13 @@ static int tcan4x5x_init(struct m_can_classdev *cdev)
|
267 | 269 | if (ret)
|
268 | 270 | return ret;
|
269 | 271 |
|
| 272 | + if (tcan4x5x->nwkrq_voltage_vio) { |
| 273 | + ret = regmap_set_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG, |
| 274 | + TCAN4X5X_NWKRQ_VOLTAGE_VIO); |
| 275 | + if (ret) |
| 276 | + return ret; |
| 277 | + } |
| 278 | + |
270 | 279 | return ret;
|
271 | 280 | }
|
272 | 281 |
|
@@ -318,6 +327,14 @@ static const struct tcan4x5x_version_info
|
318 | 327 | return &tcan4x5x_versions[TCAN4X5X];
|
319 | 328 | }
|
320 | 329 |
|
| 330 | +static void tcan4x5x_get_dt_data(struct m_can_classdev *cdev) |
| 331 | +{ |
| 332 | + struct tcan4x5x_priv *tcan4x5x = cdev_to_priv(cdev); |
| 333 | + |
| 334 | + tcan4x5x->nwkrq_voltage_vio = |
| 335 | + of_property_read_bool(cdev->dev->of_node, "ti,nwkrq-voltage-vio"); |
| 336 | +} |
| 337 | + |
321 | 338 | static int tcan4x5x_get_gpios(struct m_can_classdev *cdev,
|
322 | 339 | const struct tcan4x5x_version_info *version_info)
|
323 | 340 | {
|
@@ -453,6 +470,8 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
|
453 | 470 | goto out_power;
|
454 | 471 | }
|
455 | 472 |
|
| 473 | + tcan4x5x_get_dt_data(mcan_class); |
| 474 | + |
456 | 475 | tcan4x5x_check_wake(priv);
|
457 | 476 |
|
458 | 477 | ret = tcan4x5x_write_tcan_reg(mcan_class, TCAN4X5X_INT_EN, 0);
|
|
0 commit comments