Skip to content

mt6589: Pinctrl v2 driver#25

Draft
akku1139 wants to merge 24 commits intoblade/v6.16from
dev/v6.16/mt6589-pinctrl-v2
Draft

mt6589: Pinctrl v2 driver#25
akku1139 wants to merge 24 commits intoblade/v6.16from
dev/v6.16/mt6589-pinctrl-v2

Conversation

@akku1139
Copy link
Member

@akku1139 akku1139 commented Mar 2, 2026

No description provided.

@akku1139
Copy link
Member Author

akku1139 commented Mar 2, 2026

9f74dcf 676a820
wrong subsystem

@akku1139
Copy link
Member Author

akku1139 commented Mar 2, 2026

there are no users in downstream, and mainline.

https://github.com/bq/aquaris-5/blob/bc1d0d0e35c969670e2d869001be944ad0c9c5e5/mediatek/platform/mt6589/kernel/drivers/mmc-host/sd.c#L1192-L1230

static const struct mtk_pin_field_calc mt6589_pin_tdsel_range[] = {
	/* CON0 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0700, 0x0, _s_bit, 3, 32, 0),
	/* CON1 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0710, 0x0, _s_bit, 3, 32, 0),
	/* CON2 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0720, 0x0, _s_bit, 3, 32, 0),
	/* CON3 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0730, 0x0, _s_bit, 3, 32, 0),
	/* CON4 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0740, 0x0, _s_bit, 3, 32, 0),
	/* CON5 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0750, 0x0, _s_bit, 3, 32, 0),
	/* CON6 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 1, 0x0760, 0x0, _s_bit, 3, 32, 0),
	/* CON7 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 1, 0x0770, 0x0, _s_bit, 3, 32, 0),
	/* CON8 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0780, 0x0, _s_bit, 3, 32, 0),
	/* CON9 */
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, 0x0790, 0x0, _s_bit, 3, 32, 0),
};

static const struct mtk_pin_field_calc mt6589_pin_rdsel_range[] = {
};

[PINCTRL_PIN_REG_TDSEL] = MTK_RANGE(mt6589_pin_tdsel_range),
[PINCTRL_PIN_REG_RDSEL] = MTK_RANGE(mt6589_pin_rdsel_range),

@akku1139
Copy link
Member Author

akku1139 commented Mar 2, 2026

/*
 * mt6589_drv_grp: DRV_GRP
 * grp 0: DRV_GRP4
 * grp 1: DRV_GRP1
 * grp 2: DRV_GRP3
 * grp 3: DRV_GRP5
 */

/*
* E2, E4, E8, E16: Drive
* SR: ???
* DM: Dummy
* MSB <-> LSB
*/
static const struct mtk_drv_group_desc mt6589_drv_grp[] = {
/* grp 0: SR E8 E4 E2: 2/4/6/8/10/12/14/16mA */
MTK_DRV_GRP(2, 16, 0, 2, 2),
/* grp 1: SR E8 E4 DM: 4/8/12/16mA */
MTK_DRV_GRP(4, 16, 1, 2, 4),
/* grp 2: SR E4 E2 DM: 2/4/6/8mA */
MTK_DRV_GRP(2, 8, 1, 2, 2),
/* grp 3: SR E16 E8 E4 4/8/12/16/20/24/28/32mA */
MTK_DRV_GRP(4, 32, 0, 2, 4),
};

/**
* struct mtk_drive_desc - the structure that holds the information
* of the driving current
* @min: the minimum current of this group
* @max: the maximum current of this group
* @step: the step current of this group
* @scal: the weight factor
*
* formula: output = ((input) / step - 1) * scal
*/
struct mtk_drive_desc {
u8 min;
u8 max;
u8 step;
u8 scal;
};
/* The groups of drive strength */
static const struct mtk_drive_desc mtk_drive[] = {
[DRV_GRP0] = { 4, 16, 4, 1 },
[DRV_GRP1] = { 4, 16, 4, 2 },
[DRV_GRP2] = { 2, 8, 2, 1 },
[DRV_GRP3] = { 2, 8, 2, 2 },
[DRV_GRP4] = { 2, 16, 2, 1 },
[DRV_GRP5] = { 4, 32, 4, 1 },
};

@akku1139
Copy link
Member Author

akku1139 commented Mar 3, 2026

note: MT6589's pullen means R1

This was referenced Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant